How i can provide "other attributes" to jira soap interface?

Moderators: Amaradana, TurboPT, TL Developers

How i can provide "other attributes" to jira soap interface?

Postby lbt » Tue Sep 03, 2013 6:59 pm

Hello all,

could you help me how i can provide "other attributes", necessary for creation of new issue in Jira, to jira soap interface?
TestLink version 1.9.7
Jira version v4.3.4#620-r152668

Our jira setting requires these mandatory parameters for issuetype=Bug: Project, Issue Type, Summary, Security Level, Type, Severity, Environment, Description

My jirasoapInterface.class.php looks like:
<issuetracker>
<username>testlink</username>
<password>xxxxxxxx</password>
<uribase>https://bsc.com/jira/</uribase>
<uriwsdl>https://bsc.com/jira/rpc/soap/jirasoapservice-v2?wsdl</uriwsdl>
<uriview>https://bsc.com/jira/browse/</uriview>
<uricreate>https://bsc.com/jira/secure/CreateIssue%21default.jspa</uricreate>
<!-- Configure This if you want be able TO CREATE ISSUES -->
<projectkey>20008887</projectkey>
<issuetype>1</issuetype>
<!-- Configure This if you need to provide other attributes -->
<attributes>
<environment>BSC</environment>
<security>Private</security>
<customFieldValues>
<customFieldValue_1>
<customfieldId>customfield_10375</customfieldId>
<values>No User problem</values>
</customFieldValue_1>
<customFieldValue_2>
<customfieldId>customfield_10374</customfieldId>
<values>Cosmetic</values>
</customFieldValue_2>
</customFieldValues>
</attributes>
</issuetracker>

Error has occured after performing Create Issue action in Test Execution:
Create JIRA Ticket FAILURE => com.atlassian.jira.rpc.exception.RemoteValidationException: Custom field ID 'null' is invalid. - serialized issue:a:8:{s:7:"project";s:8:"20008887";s:4:"type";i:1;s:7:"summary";s:99:"/TBC Retail/Login Page/TBC_R-4:Change the Language - Executed ON (ISO FORMAT): 2013-02-25 16:06:23";s:11:"description";s:227:"Execution ID: 10534 Tester: admin Test Plan: TBC Retail - Regression Test Platform: Firefox Build: TBC Retail HF ver. 6.17.1.0 Executed ON (ISO FORMAT): 2013-02-25 16:06:23 Execution Status: passed OK Good Job!";s:11:"environment";s:3:"BSC";s:8:"security";s:7:"Private";s:17:"customFieldValues";a:2:{i:0;a:1:{s:18:"customFieldValue_1";s:17:"customfield_10375";}i:1;a:1:{s:18:"customFieldValue_1";s:15:"No User problem";}}s:9:"issuetype";i:1;}

Could you give me any advice how I can configure other mandatory attributes in jirasoapInterface.class.php that are necessary for sucessfully creation of new issue in jira?

Thank you for advice
lbt
TestLink user
 
Posts: 2
Joined: Sun Sep 01, 2013 2:45 pm

Re: How i can provide "other attributes" to jira soap interf

Postby fman » Tue Sep 03, 2013 8:00 pm

what about a step by step approach, then avoid to provide custom fields is are not mandatories ?
the error message is saying something about custom field id not about mandatories fields you have mentioned.
fman
Member of TestLink Community
 
Posts: 3063
Joined: Tue Nov 15, 2005 7:19 am

Re: How i can provide "other attributes" to jira soap interf

Postby lbt » Mon Sep 09, 2013 4:15 pm

If I put just projectkey and issuetype attributes without other mandatory parameters, I get following error:

Add bug report
Create JIRA Ticket FAILURE => com.atlassian.jira.rpc.exception.RemoteValidationException: {customfield_10375=Severity is required., environment=Environment is required., security=Security Level is required., customfield_10374=Type is required.} : [] - serialized issue:a:5:{s:7:"project";s:8:"20008887";s:4:"type";i:1;s:7:"summary";s:99:"/TBC Retail/Login Page/TBC_R-4:Change the Language - Executed ON (ISO FORMAT): 2013-02-25 16:06:23";s:11:"description";s:227:"Execution ID: 10534 Tester: admin Test Plan: TBC Retail - Regression Test Platform: Firefox Build: TBC Retail HF ver. 6.17.1.0 Executed ON (ISO FORMAT): 2013-02-25 16:06:23 Execution Status: passed OK Good Job!";s:9:"issuetype";i:1;}

My jirasoapInterface.class.php now looks like:
<issuetracker>
<username>testlink</username>
<password>xxxxxxxx</password>
<uribase>https://bsc.com/jira/</uribase>
<uriwsdl>https://bsc.com/jira/rpc/soap/jirasoapservice-v2?wsdl</uriwsdl>
<uriview>https://bsc.com/jira/browse/</uriview>
<uricreate>https://bsc.com/jira/secure/CreateIssue%21default.jspa</uricreate>
<!-- Configure This if you want be able TO CREATE ISSUES -->
<projectkey>20008887</projectkey>
<issuetype>1</issuetype>
</issuetracker>

Or what do you mean as step by step approach?
lbt
TestLink user
 
Posts: 2
Joined: Sun Sep 01, 2013 2:45 pm

Re: How i can provide "other attributes" to jira soap interf

Postby fman » Mon Sep 09, 2013 5:46 pm

1. do not edit any .class.php, you have to do configuration via GUI

2. step by step approach means:
create a simple test project on JIRA with as least as possible mandatory data
then check it work ok
increase the amount of mandatory data AVOIDING Custom Fields
then check it work ok


In order to provide me with a common place to test, please create a jiraondemand site (is free), configure it
and provide me credentials.
This way we both will see same things.
This is the only help I can offer
fman
Member of TestLink Community
 
Posts: 3063
Joined: Tue Nov 15, 2005 7:19 am

Re: How i can provide "other attributes" to jira soap interf

Postby Xsharp » Tue Oct 08, 2013 1:38 pm

Hi fman:
step1 and 2 are ok for me but I'm stack with custom field configuration. I explain:
I can link to existing issue but I can't create new issue because of Jira custom fields configuration witch are required. I get the error below when I do so:
Create JIRA Ticket FAILURE => com.atlassian.jira.rpc.exception.RemoteValidationException: {customfield_10700=Phase est obligatoire., versions=Affecte la/les version(s) est obligatoire., priority=Priorité est obligatoire., customfield_10100=Sévérité est obligatoire.} : [] - serialized issue:a:5:{s:7:"project";s:3:"GIC";s:4:"type";i:1;s:7:"summary";s:79:"/JenkinsTest/TS1/J-1:sayPassed - Executed ON (ISO FORMAT): 2013-10-07 15:50:39";s:11:"description";s:180:"Execution ID: 3875 Tester: hm Test Plan: JenkinsTestPlan Platform: GOI2 Build: TestBuild Executed ON (ISO FORMAT): 2013-10-07 15:50:39 Execution Status: failed ";s:9:"issuetype";i:1;

My setup is : TestLink 1.9.8 and JIRA v6.0.8
Thanks for your help.
Xsharp
Advanced user
 
Posts: 17
Joined: Mon Dec 31, 2012 2:08 pm
Location: Montreal, Canada.

Re: How i can provide "other attributes" to jira soap interf

Postby Xsharp » Tue Oct 08, 2013 3:57 pm

I did find how to configure all mandatory fields as below:

<attributes>
<Environnement>Anomalie</Environnement>
<versions>3.9.10</versions>
<priority>Normale</priority>
<customFieldValues>
<customFieldValue_1>
<customfieldId>customfield_10700</customfieldId>
<values>Codage</values>
</customFieldValue_1>
<customFieldValue_2>
<customfieldId>customfield_10100</customfieldId>
<values>Moyenne</values>
</customFieldValue_2>
</customFieldValues>
</attributes>
</issuetracker>

but I still get an error when I try to create a new issue:


Ajouter un rapport d’anomalie Aide

Create JIRA Ticket FAILURE => com.atlassian.jira.rpc.exception.RemoteValidationException: Custom field ID 'null' is invalid. - serialized issue:a:9:{s:7:"project";s:3:"GIC";s:4:"type";i:1;s:7:"summary";s:85:"/JenkinsTest/TS1/J-1:sayPassed - Exécuté sur ON (ISO FORMAT): 2013-10-07 15:50:39";s:11:"description";s:195:" ID d'exécution: 3875 Testeur: hm Campagne: JenkinsTestPlan Platforme: GOI2 Build: TestBuild Exécuté sur ON (ISO FORMAT): 2013-10-07 15:50:39 Statut d'exécution : failed ";s:13:"Environnement";s:8:"Anomalie";s:8:"versions";s:6:"3.9.10";s:8:"priority";s:7:"Normale";s:17:"customFieldValues";a:2:{i:0;a:1:{s:18:"customFieldValue_1";s:17:"customfield_10700";}i:1;a:1:{s:18:"customFieldValue_1";s:6:"Codage";}}s:9:"issuetype";i:1;}
Xsharp
Advanced user
 
Posts: 17
Joined: Mon Dec 31, 2012 2:08 pm
Location: Montreal, Canada.

Re: How i can provide "other attributes" to jira soap interf

Postby fman » Tue Oct 08, 2013 9:25 pm

found this may be can help, still working on this
https://answers.atlassian.com/questions ... ruby-savon
fman
Member of TestLink Community
 
Posts: 3063
Joined: Tue Nov 15, 2005 7:19 am

Re: How i can provide "other attributes" to jira soap interf

Postby Xsharp » Wed Oct 09, 2013 7:34 pm

@Fman
Thanks for your quick responding. I'll have a look at this link.
got more information when using test.jiraOnDemand.jirasoapInterface.class.php It may helps

Testing BST Integration - jirasoapInterface
Configuration settings

<issuetracker> <username>hm</username> <password>xxxx</password> <uribase>http://jira.tid.local/</uribase> <uriwsdl>http://jira.tid.local/rpc/soap/jirasoapservice-v2?wsdl</uriwsdl> <uriview>http://jira.tid.local/browse/</uriview> <uricreate>http://jira.tid.local/secure/CreateIssue!default.jspa</uricreate> <projectkey>GIC</projectkey> <issuetype>1</issuetype> <attributes> <customFieldValues> <customFieldValue_1> <customfieldId>customfield_10100</customfieldId> <values>Moyenne</values> </customFieldValue_1> <customFieldValue_2> <customfieldId>customfield_10700</customfieldId> <values>Codage</values> </customFieldValue_2> </customFieldValues> <environment>Anomalie</environment> <versions>3.9.10</versions> <priority>3</priority> </attributes> </issuetracker>

Creating INTERFACE
Connection OK?
bool(true) Get Issue Summary
object(stdClass)#94 (27) { ["id"]=> string(6) "109301" ["affectsVersions"]=> array(1) { [0]=> object(stdClass)#93 (6) { ["id"]=> string(5) "15163" ["name"]=> string(6) "3.9.10" ["archived"]=> bool(false) ["releaseDate"]=> NULL ["released"]=> bool(false) ["sequence"]=> int(64) } } ["assignee"]=> string(11) "fx" ["attachmentNames"]=> array(0) { } ["components"]=> array(0) { } ["created"]=> string(24) "2013-10-09T18:26:07.000Z" ["customFieldValues"]=> array(2) { [0]=> object(stdClass)#92 (3) { ["customfieldId"]=> string(17) "customfield_10700" ["key"]=> NULL ["values"]=> array(1) { [0]=> string(6) "Codage" } } [1]=> object(stdClass)#91 (3) { ["customfieldId"]=> string(17) "customfield_10100" ["key"]=> NULL ["values"]=> array(1) { [0]=> string(7) "Moyenne" } } } ["description"]=> string(83) "Test intégration TestLink avec JIRA : les champs personnalisés pausent problème." ["duedate"]=> NULL ["environment"]=> NULL ["fixVersions"]=> array(0) { } ["key"]=> string(7) "GIC-887" ["priority"]=> string(1) "3" ["project"]=> string(3) "GIC" ["reporter"]=> string(11) "fx" ["resolution"]=> NULL ["status"]=> string(1) "1" ["summary"]=> string(35) "Test integration TestLink avec JIRA" ["type"]=> string(1) "1" ["updated"]=> string(24) "2013-10-09T18:26:07.000Z" ["votes"]=> int(0) ["IDHTMLString"]=> string(17) "GIC-887 : " ["statusCode"]=> string(1) "1" ["statusVerbose"]=> string(5) "Émis" ["statusHTMLString"]=> string(8) "[Émis] " ["summaryHTMLString"]=> string(35) "Test integration TestLink avec JIRA" ["isResolved"]=> bool(false) }
Get Issue Summary
Test d'integration de JIRA avec TestLink
array(3) { ["status_ok"]=> bool(false) ["id"]=> int(-1) ["msg"]=> string(545) "Create JIRA Ticket FAILURE => com.atlassian.jira.rpc.exception.RemoteValidationException: Custom field ID 'null' is invalid. - serialized issue:a:9:{s:7:"project";s:3:"GIC";s:4:"type";i:1;s:7:"summary";s:24:"Issue Via API 2013-02-04";s:11:"description";s:36:"Do Androids Dream of Electric Sheep?";s:17:"customFieldValues";a:2:{i:0;a:1:{s:18:"customFieldValue_1";s:17:"customfield_10100";}i:1;a:1:{s:18:"customFieldValue_1";s:7:"Moyenne";}}s:11:"environment";s:8:"Anomalie";s:8:"versions";s:6:"3.9.10";s:8:"priority";s:1:"3";s:9:"issuetype";i:1;}" }
Xsharp
Advanced user
 
Posts: 17
Joined: Mon Dec 31, 2012 2:08 pm
Location: Montreal, Canada.

Re: How i can provide "other attributes" to jira soap interf

Postby Xsharp » Thu Oct 10, 2013 2:29 pm

>>found this may be can help, still working on this
https://answers.atlassian.com/questions ... ruby-savon
it was helpful. I tweaked the addIssue() function of jirasoapInterface.class.php to add custom fields values instead of leaving them on the xml configuration side and got no more the error ...Custom field ID 'null' is invalid...

$issue = array('project' => (string)$this->cfg->projectkey,
'type' => (int)$this->cfg->issuetype,
'summary' => $summary,
'description' => $description,
'customFieldValues' => array( array('customfieldId' => 'customfield_10100','values' => array('Moyenne')),
array('customfieldId' => 'customfield_10700','values' => array('Codage'))));

Still now an issue with the versions field witch I think its type is array and need to specify the id of the item chosen for the version instead of putting its value (as it's done for the components).
Any idea of what would be the xml configuration for the custom fiels attribute to avoid tweak jirasoapInterface.class.php?
Xsharp
Advanced user
 
Posts: 17
Joined: Mon Dec 31, 2012 2:08 pm
Location: Montreal, Canada.

Re: How i can provide "other attributes" to jira soap interf

Postby fman » Thu Oct 10, 2013 2:35 pm

I'm still struggling with this part, trying to understand how to create the right XML.
I will post the feedback, but will need not less than a couple of days.

Info available is not good (at least for me)
I'm trying to use wsdl2php to get more inside info
fman
Member of TestLink Community
 
Posts: 3063
Joined: Tue Nov 15, 2005 7:19 am

Re: How i can provide "other attributes" to jira soap interf

Postby Xsharp » Fri Oct 18, 2013 9:14 pm

still struggling with the version field.
If I make a dump of the variable issue that I created before in JIRA I get :

object(stdClass)#3 (21) { ["id"]=> string(6) "109300" ["affectsVersions"]=> array(1) { [0]=> object(stdClass)#4 (6) { ["id"]=> string(5) "15163" ["name"]=> string(6) "3.9.10" ["archived"]=> bool(false) ["releaseDate"]=> NULL ["released"]=> bool(false) ["sequence"]=> int(64) } } ["assignee"]=> string(8) "hm" ["attachmentNames"]=> array(0) { } ["components"]=> array(0) { } ["created"]=> string(24) "2013-10-07T19:59:53.000Z" ["customFieldValues"]=> array(1) { [0]=> object(stdClass)#5 (3) { ["customfieldId"]=> string(17) "customfield_10100" ["key"]=> NULL ["values"]=> array(1) { [0]=> string(7) "Moyenne" } } } ["description"]=> string(40) "Test d'integration de JIRA avec TestLink" ["duedate"]=> NULL ["environment"]=> NULL ["fixVersions"]=> array(0) { } ["key"]=> string(7) "GIC-886" ["priority"]=> string(1) "3" ["project"]=> string(3) "GIC" ["reporter"]=> string(8) "hm" ["resolution"]=> NULL ["status"]=> string(1) "1" ["summary"]=> string(40) "Test d'integration de JIRA avec TestLink" ["type"]=> string(1) "1" ["updated"]=> string(24) "2013-10-16T19:24:59.000Z" ["votes"]=> int(0) }

So I guess that If I want to create a new issue the versions witch is a required field would be :
'affectsVersions' => array('id'=> '15163','name'=> '3.9.10','archived' => false,'releaseDate' => NULL,'released' => 'false','sequence'=> 64),
but don't succeed and get the exception : com.atlassian.jira.rpc.exception.RemoteValidationException: {versions=Affecte la/les version(s) est obligatoire.} : []
Last edited by Xsharp on Sun Oct 20, 2013 10:05 pm, edited 1 time in total.
Xsharp
Advanced user
 
Posts: 17
Joined: Mon Dec 31, 2012 2:08 pm
Location: Montreal, Canada.

Re: How i can provide "other attributes" to jira soap interf

Postby fman » Sun Oct 20, 2013 8:57 am

Have found some issues on additional attributes management, please stay tunned on http://mantis.testlink.org/view.php?id=5981
fman
Member of TestLink Community
 
Posts: 3063
Joined: Tue Nov 15, 2005 7:19 am

Re: How i can provide "other attributes" to jira soap interf

Postby Xsharp » Tue Oct 29, 2013 7:50 pm

Solved!
I never thought that I would be able to go throw this issue but my perseverance has payed!
here you go : how to affect a version to an issue and its required fields
// Create a new issue
$new = array(
'project' => 'GIC',
'type' => 1,
'summary' => 'Jira integration Test',
'description' => 'bar',
'affectsVersions' => array(array('id'=>'15163','archived' => false,'released' => 'false')),
'environment' => 'Anomalie',
'priority' => '3',
'customFieldValues' => array( array('customfieldId' => 'customfield_10100',
'values' => array('Moyenne')),
array('customfieldId' => 'customfield_10700',
'values' => array('Codage'))
)
);

$jira->create_issue($new);
I will add it on http://mantis.testlink.org/view.php?id=5981
Xsharp
Advanced user
 
Posts: 17
Joined: Mon Dec 31, 2012 2:08 pm
Location: Montreal, Canada.

Re: How i can provide "other attributes" to jira soap interf

Postby amidalice » Thu Mar 20, 2014 1:16 pm

I am trying to get this working with the latest release 1.9.9 but I have problems. the fixVersion field is mandatory for me but I could not figure out how to specify it correctly. the issue tracker config looks like this:

<issuetracker>
...
<attributes>
<fixVersions>
<version><id>10335</id><archived>false</archived><released>false</released></version>
</fixVersions>
</attributes>
</issuetracker>

(i also tried with empty archived and released tags) but when I try to create an issue i get

Create JIRA Ticket FAILURE => SOAP-ERROR: Encoding: object hasn't 'archived' property - serialized issue:a:6:{s:7:"project";s:4:"ECOM";s:4:"type";i:1;s:7:"summary";s:116:"Test-1510:Test Case - Executed ON (ISO FORMAT): 2013-05-14 08:25:25";s:11:"description";s:176:"Execution ID: 5317 Tester: admin Test Plan: Automated Tests Platform: Eclipse Build: 8.0 Executed ON (ISO FORMAT): 2013-05-14 08:25:25 Execution Status: failed ";s:11:"fixVersions";a:3:{i:0;a:1:{s:7:"version";s:5:"10335";}i:1;a:1:{s:7:"version";s:5:"false";}i:2;a:1:{s:7:"version";s:5:"false";}}s:9:"issuetype";i:1;}

any ideas on what I am doing wrong?

another question: is it somehow possible to dynamicaly use the username of the tester as reporter of the issue? or the build the testcase was executed for as affectsVersions?
amidalice
TestLink user
 
Posts: 2
Joined: Mon Feb 11, 2013 7:59 pm

Re: How i can provide "other attributes" to jira soap interf

Postby gguenther » Mon Apr 14, 2014 6:33 pm

amidalice wrote:another question: is it somehow possible to dynamicaly use the username of the tester as reporter of the issue? or the build the testcase was executed for as affectsVersions?


I also would like to know how to do this, as long as the testlink user name and jira user name match this should be possible but I can't figure out how to do it. Testlink already knows this information as it is posting it in the jira bug description. not a php expert sorry but I'm learning so any help would be much appreciated.
gguenther
TestLink user
 
Posts: 2
Joined: Sat Apr 12, 2014 7:04 am


Return to Jira



Who is online

Users browsing this forum: No registered users and 1 guest