Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007228TestLinkBug Tracking System - Redmine Integrationpublic2015-08-13 14:082015-09-19 08:49
Reporterangelelvira83 
Assigned Tofman 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSLinuxOS VersionUbuntu
Product Version1.9.13 (2015 #1) 
Fixed in Version1.9.14 (2015 Q3) 
Summary0007228: Issue creation with custom fields in Redmine is not working
DescriptionWhen i try to create an issue (with 2 mandatory custom fields) directly in redmine using Testlink, i receive the following error (entry in eventlog):

Create REDMINE Ticket FAILURE => redmine::_requesturl:http://redmine.mycompany.sp/redmine [^] - response:{"url":"http:\/\/redmine.mycompany.at\/issues.xml","content_type":"application\/xml; charset=utf-8","http_code":500,"header_size":354,"request_size":450,"filetime":-1,"ssl_verify_result":0,"redirect_count":0,"total_time":0.073383,"namelookup_time":5.3e-5,"connect_time":6.3e-5,"pretransfer_time":0.000148,"size_upload":156,"size_download":116,"speed_download":1580,"speed_upload":2125,"download_content_length":116,"upload_content_length":156,"starttransfer_time":0.07329,"redirect_time":0,"redirect_url":"","primary_ip":"10.102.225.93","certinfo":[],"primary_port":82,"local_ip":"10.102.225.98","local_port":36941} - content: "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<hash>\n <status>500<\/status>\n <error>Internal Server Error<\/error>\n<\/hash>\n"


When i link an existing issue (and in a comment creation), everything works fine.

This is my tracker config:

<issuetracker>
<apikey>apikey</apikey>
<uribase>http://redmine.mycompany.at/</uribase> [^] [^]
<uriview>http://redmine.mycompany.at/issues/</uriview> [^] [^]
<projectidentifier>myproject-id</projectidentifier>
<attributes>
<custom_fields type="array">
   <custom_field name="Name 1" id="1">
      <value>Value1</value>
   </custom_field>
   <custom_field name="Name 2" id="2">
      <value>Value2</value>
   </custom_field>
</custom_fields>
</attributes>
</issuetracker>

Connection test says OK.
Steps To ReproduceSame that

http://mantis.testlink.org/view.php?id=7096#c23254 [^]
TagsNo tags attached.
Database (MySQL,Postgres,etc)MySQL
BrowserALL
PHP Version
TestCaseID
QA Team - Task Workflow StatusREADY FOR TESTING
Attached Filespng file icon redmin-custom-fields-definition.png [^] (26,246 bytes) 2015-08-15 07:36


png file icon CF.png [^] (12,223 bytes) 2015-08-17 09:00

- Relationships
child of 0006830closedfman Availables hot-fixes for 1.9.13 & How To get full fixed package from GitHub 

-  Notes
(0023736)
fman (administrator)
2015-08-13 17:27

There is something that is not clear:
if your issue is same that 7096, and 7096 is set resolved on 1.9.14 (ie version still not released but code that can be got from github) does that your report means that you have tried the fix and did not work ?
If instead you are still using 1.9.13 how do you expect that can work?

in addition
1) if your issue is a duplicate => do not report again
2) do not use all available channels creating rumor and lot of work, because you have today posted on forum.
(0023737)
fman (administrator)
2015-08-13 17:28

has duplicate issue setted to resolved
(0023739)
fman (administrator)
2015-08-13 20:39

it seems that info provided by user and related ticket are not realy related
(0023740)
fman (administrator)
2015-08-13 20:40
edited on: 2015-08-13 20:55

links that may be can help
http://www.redmine.org/boards/2/topics/17070 [^]
https://github.com/kbsali/php-redmine-api [^]
https://github.com/kbsali/php-redmine-api/blob/master/test/Redmine/Tests/IssueXmlTest.php [^]
https://github.com/maxtepkeev/python-redmine/issues/10 [^]
http://stackoverflow.com/questions/24248903/how-to-insert-custom-fields-in-redmine-with-this-script [^]

(0023741)
fman (administrator)
2015-08-13 20:47

it's critic to understand whe do you have found that you can use this sintax


<custom_fields type="array">
   <custom_field name="Name 1" id="1">
      <value>Value1</value>
   </custom_field>
   <custom_field name="Name 2" id="2">
      <value>Value2</value>
   </custom_field>
</custom_fields>


would you mind to explain?
(0023742)
fman (administrator)
2015-08-13 20:53

It's seems that you have got this info from redmine API doc and applied to TestLink without verifying that TestLink support same syntax.
Please in future avoid this kind of guessing.
First check the (unfortunately scarse) documentation provided by TestLink, or check TestLink code, or ask in forum.testlink.org
(0023762)
fman (administrator)
2015-08-15 08:58

work in progress.
new examples:
https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/a9622ba4fbc558f44494ab5bc555362ef80eca42 [^]

https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/55a8cd72e6667d520f5328fd36674fde9eea5250 [^]
(0023763)
fman (administrator)
2015-08-15 09:16
edited on: 2015-08-15 09:17

IMPORTANT NOTICE

1. Because Custom fields values are specified as a configuration , values will be the same for all issues, and till (may be?) future implementations, user will not be able to edit it when creating issue from TestLink.

2. Custom fields will be specified OUTSIDE THE attributes section.
3. Custom fields will be specified using the Redmine syntax explained in the Redmine API documentation pages on redmine site.
A simple example of TestLink configuration

<issuetracker>
  <apikey>ff51e7e6c5b2349f95bef327d961e526abd45638</apikey>
  <uribase>http://localhost:8080/redmine</uribase> [^]
  <projectidentifier>thor</projectidentifier>
  

  <custom_fields type="array">
    <custom_field id="1" name="CF-STRING-OPT">
      <value>SALAME</value>
    </custom_field>
    <custom_field id="3" name="CF-LIST-OPT" multiple="true">
      <value type="array">
        <value>ALFA</value>
      </value>
    </custom_field>
  </custom_fields>

</issuetracker>

(0023764)
fman (administrator)
2015-08-15 15:45

https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/1c1d4bc5d9c3ad10533b63ea7bde2978542fb1d4 [^]

please get latest code from github, do fresh install, retest & provide feedback.
(0023768)
angelelvira83 (reporter)
2015-08-17 07:01
edited on: 2015-08-17 07:09

Hi,

I downloaded the latest code and i have testing it.

My issuetracker configuration is:

<issuetracker>
<apikey>MY_KEY</apikey>
<uribase>REDMINE_URI</uribase>
<uriview>REDMINE_URI_VIEW</uriview>
<projectidentifier>IDENTIFIER</projectidentifier>
<custom_fields type="array">
   <custom_field id="2" name="CUSTOM_2">
      <value>Value2</value>
   </custom_field>
   <custom_field id="47" name="CUSTOM_47">
      <value>Value47</value>
   </custom_field>
</custom_fields>
</issuetracker>

When I create an issue, the problem is:

Create REDMINE Ticket FAILURE => redmine::_requesturl:URI_REDMINE -
response:{"url":"URI_REDMINE\/issues.xml","content_type":"application\/xml; charset=utf-8","http_code":422,"header_size":431,
"request_size":580,"filetime":-1,"ssl_verify_result":0,"redirect_count":0,"total_time":0.106286,"namelookup_time":5.5e-5,
"connect_time":6.5e-5,"pretransfer_time":0.000138,"size_upload":356,"size_download":186,"speed_download":1749,"speed_upload":3349,
"download_content_length":-1,"upload_content_length":356,"starttransfer_time":0.105667,"redirect_time":0,"redirect_url":"
","primary_ip":"PRIMARY_IP","certinfo":[],"primary_port":82,"local_ip":"LOCAL_UP","local_port":42553} -
content: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><errors type=\"array\">
<error>C\CUSTOM_2 no puede estar en blanco<\/error><error>Tipo CUSTOM_47 no puede estar en blanco<\/error><\/errors>"

The custom fields are mandatory, obviously

If helps, in the function "completeCfg" i have put and "var_dump" in the line 118 (before the "asXML) and i retrieve (OK)

object(SimpleXMLElement)0000154 (2) { ["@attributes"]=> array(1) { ["type"]=> string(5) "array" } ["custom_field"]=> array(2) { [0]=> object(SimpleXMLElement)0000167 (2) { ["@attributes"]=> array(2) { ["id"]=> string(1) "2" ["name"]=> string(23) "CUSTOM_2" } ["value"]=> string(8) "VALUE_2" } [1]=> object(SimpleXMLElement)0000166 (2) { ["@attributes"]=> array(2) { ["id"]=> string(2) "47" ["name"]=> string(15) "CUSTOM_47" } ["value"]=> string(6) "VALUE_47" } } }

However the var_dump after the "asXML":

object(SimpleXMLElement)0000167 (2) { ["@attributes"]=> array(1) { ["type"]=> string(5) "array" } [0]=> string(253) " CUSTOM_2 CUSTOM_47 " }

I apologize for not being able to help more (I am not an expert)

(0023769)
fman (administrator)
2015-08-17 08:13

Can you start doing a Check on NOT MANDATORY CF?
(0023770)
angelelvira83 (reporter)
2015-08-17 08:25

When CF is not mandatory the issue is successfully opened, but CF are empty (no error in execution traces)
(0023771)
fman (administrator)
2015-08-17 08:44

I need more details.
1) You need to provide details of your custom fields definition as I've done with the screen shot.
Without this info is impossible to be sure that we are using same scenario, and this means I need to use too much time on this.

I'm going to recheck the test I've done before releasing.
Thanks
(0023772)
fman (administrator)
2015-08-17 11:56

Just tested with latest code

1. create issue while recording exec result
   => Created OK on REDMINE OK, with Custom Field values
   => Got bad message to display on TestLink >= NEED TO CHECK
   
2. After result recording, using BUG ADD ICON
   => Created OK on REDMINE OK, with Custom Field values
   => Got NO FEEDBACK to display on TestLink >= NEED TO CHECK
(0023773)
fman (administrator)
2015-08-17 17:22

My Issues were related TO CALL TIME OUT => issue was created on Redmine, but communication timeout then TestLink has no useful return info.

Increased timeout to 60 sec

commit:
https://github.com/TestLinkOpenSourceTRMS/testlink-code/commit/64798aaca2eca49fd98630f499d25f838cc1cc21 [^]
(0023775)
angelelvira83 (reporter)
2015-08-18 06:30

Test in progress... but at this moment don't works for my.

If helps,

"var_dump($XMLString)" in "addIssueFromXMLString" shows:

string(351) " TitleNotesProjectID VALUE_CUSTOM_FIELD1 VALUE_CUSTOM_FIELD2 "
(0023777)
fman (administrator)
2015-08-18 08:48

Unfortunately I can not help you.
From my side things work ok
regarding dump Attention that when yoy try to display XML on browser you can not do a simple var_dump(), give a look also to <xmp> TAG.
(0023779)
angelelvira83 (reporter)
2015-08-18 11:24
edited on: 2015-08-18 11:25

With function "htmlspecialchars" (instead of var_dump) i can view that info is apparently correct:

               <?xml version="1.0"?>
<issue><subject>subject</subject><description>description</description><project_id>844</project_id><custom_fields type="array">
   <custom_field name="CUSTOM_2" id="2"><value>value_2</value></custom_field>
   <custom_field name="CUSTOM_47" id="47"><value>value_47</value></custom_field>
</custom_fields></issue>


TRANSLATED

               <?xml version='1.0'?>
<issue><subject>subject</subject><description>description</description><project_id>844</project_id><custom_fields type='array'>
   <custom_field name='CUSTOM_2' id='2'><value>value_2</value></custom_field>
   <custom_field name='CUSTOM_47' id='47'><value>value_47</value></custom_field>
</custom_fields></issue>

But creation fails. It must be a local problem

Thank you very much for all....

(0023780)
fman (administrator)
2015-08-18 12:04

ok. let me know if you find the reason
(0023781)
angelelvira83 (reporter)
2015-08-18 12:36

Redmine used in testing is version 3.0.0

Testing with a 2.2 WORKS FINE!!!
(0023782)
fman (administrator)
2015-08-18 12:50

I've done all tests with Redmine 3.1.0-0 (from bitnami) and worked OK
(0023783)
angelelvira83 (reporter)
2015-08-18 13:49
edited on: 2015-08-18 14:20

Reviewing redmine versions and resolved issues i have see this defect:

http://www.redmine.org/issues/19368 [^]

So, i've tried with this configuration:

<issuetracker>
<apikey>MY_KEY</apikey>
<uribase>REDMINE_URI</uribase>
<uriview>REDMINE_URI_VIEW</uriview>
<projectidentifier>PROJECT_ID</projectidentifier>
<attributes>
<tracker_id>17</tracker_id> <!-- ONE EXISTING TRACKER --> CRITIC
</attributes>
<custom_fields type="array">
   <custom_field name="CUSTOM_2" id="2"><value>VALUE_2</value></custom_field>
   <custom_field name="CUSTOM_47" id="47"><value>VALUE_47</value></custom_field> </custom_field>
</custom_fields>
</issuetracker>

AND... IT WORKS in 3.0.0!!!

When we update redmine version... new test!

THANK you very much!!!

(0023786)
fman (administrator)
2015-08-18 14:20

Thanks for the info
(0023897)
fman (administrator)
2015-09-19 08:49

1.9.14 Padawan - released - 2015-09-19

- Issue History
Date Modified Username Field Change
2015-08-13 14:08 angelelvira83 New Issue
2015-08-13 17:27 fman Note Added: 0023736
2015-08-13 17:28 fman QA Team - Task Workflow Status => READY FOR TESTING
2015-08-13 17:28 fman Note Added: 0023737
2015-08-13 17:28 fman Status new => resolved
2015-08-13 17:28 fman Fixed in Version => 1.9.14 (2015 Q3)
2015-08-13 17:28 fman Resolution open => fixed
2015-08-13 17:28 fman Assigned To => fman
2015-08-13 20:39 fman Note Added: 0023739
2015-08-13 20:39 fman Status resolved => feedback
2015-08-13 20:40 fman Note Added: 0023740
2015-08-13 20:42 fman Note Edited: 0023740 View Revisions
2015-08-13 20:47 fman Note Added: 0023741
2015-08-13 20:48 fman Note Edited: 0023740 View Revisions
2015-08-13 20:49 fman Note Edited: 0023740 View Revisions
2015-08-13 20:53 fman Note Added: 0023742
2015-08-13 20:55 fman Note Edited: 0023740 View Revisions
2015-08-15 07:36 fman File Added: redmin-custom-fields-definition.png
2015-08-15 08:58 fman Note Added: 0023762
2015-08-15 09:16 fman Note Added: 0023763
2015-08-15 09:17 fman Note Edited: 0023763 View Revisions
2015-08-15 15:45 fman Note Added: 0023764
2015-08-15 15:45 fman Status feedback => resolved
2015-08-15 15:47 fman Relationship added child of 0006830
2015-08-17 07:00 angelelvira83 Note Added: 0023767
2015-08-17 07:00 angelelvira83 Note Deleted: 0023767
2015-08-17 07:01 angelelvira83 Note Added: 0023768
2015-08-17 07:09 angelelvira83 Note Edited: 0023768 View Revisions
2015-08-17 08:13 fman Note Added: 0023769
2015-08-17 08:25 angelelvira83 Note Added: 0023770
2015-08-17 08:44 fman Note Added: 0023771
2015-08-17 08:44 fman Status resolved => feedback
2015-08-17 09:00 angelelvira83 File Added: CF.png
2015-08-17 11:56 fman Note Added: 0023772
2015-08-17 17:22 fman Note Added: 0023773
2015-08-18 06:30 angelelvira83 Note Added: 0023775
2015-08-18 06:30 angelelvira83 Status feedback => assigned
2015-08-18 08:48 fman Note Added: 0023777
2015-08-18 08:54 fman Status assigned => resolved
2015-08-18 11:24 angelelvira83 Note Added: 0023779
2015-08-18 11:25 angelelvira83 Note Edited: 0023779 View Revisions
2015-08-18 12:04 fman Note Added: 0023780
2015-08-18 12:36 angelelvira83 Note Added: 0023781
2015-08-18 12:50 fman Note Added: 0023782
2015-08-18 13:49 angelelvira83 Note Added: 0023783
2015-08-18 13:52 angelelvira83 Note Edited: 0023783 View Revisions
2015-08-18 14:20 fman Note Added: 0023786
2015-08-18 14:20 fman Note Edited: 0023783 View Revisions
2015-09-19 08:49 fman Note Added: 0023897
2015-09-19 08:49 fman Status resolved => closed



Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker