JIRA Automation: get information from Custom fields

yannick ginestet March 26, 2018

hello,

 

I would like to use the content of the Custom Field_12103 of an issue to trigger action.

How to do it ?

 

For instance, i'm able to access to customfield_10009, using:

= {{issue.fields.customfield_10009}}, but i did not success to acess to the content of Custom Field_12103.

 

Any idea ?

 

 

below is an issue example, in XML format

=========================================================

<labels><label>R&D</label><label>Rail</label><label>XPR</label></labels><created>Fri, 23 Mar 2018 14:10:00 +0100</created><updated>Mon, 26 Mar 2018 15:09:18 +0200</updated><due/><votes>0</votes><watches>1</watches><attachments></attachments><subtasks></subtasks><customfields><customfield id="customfield_10009" key="com.pyxis.greenhopper.jira:gh-epic-color"><customfieldname>Epic Color</customfieldname><customfieldvalues><customfieldvalue>ghx-label-6</customfieldvalue></customfieldvalues></customfield><customfield id="customfield_10007" key="com.pyxis.greenhopper.jira:gh-epic-label"><customfieldname>Epic Name</customfieldname><customfieldvalues><customfieldvalue>EPIC Test Automation</customfieldvalue></customfieldvalues></customfield><customfield id="customfield_10008" key="com.pyxis.greenhopper.jira:gh-epic-status"><customfieldname>Epic Status</customfieldname><customfieldvalues><customfieldvalue key="10001"><![CDATA[ To Do ]]></customfieldvalue></customfieldvalues></customfield><customfield id="customfield_12504" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons"><customfieldname>Integrated into QA Exp backlog</customfieldname><customfieldvalues><customfieldvalue key="11557"><![CDATA[ Pending ]]></customfieldvalue></customfieldvalues></customfield><customfield id="customfield_12103" key="com.atlassian.jpo:jpo-custom-field-parent"><customfieldname>Parent Link</customfieldname><customfieldvalues><customfieldvalue><![CDATA[ HOM-1800 ]]></customfieldvalue></customfieldvalues></customfield>

2 answers

1 vote
Scott Harwood
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 26, 2018

Hi,

 

The best way to find the correct smart value for this is by going to the rest end point for the issue. e.g https://your-instance.com/rest/api/2/issue/<issue-key>. 

 

One you are there you will see the json structure of the issue. From that you can work out the smart value. E.g if the custom field value was

 

"customfield_12103": {

    "value": "value your looking for"

}

Then the smart value would be:

{{issue.customfield_12103.value}}

 

Hope that makes sense. Let me know how you go.

 

Cheers,

Scott.

yannick ginestet March 27, 2018

hello scott, 

 

Thanks for your time and your answer. I have initially thought like you.

 

Here's the extract from resp/api

{"expand":"renderedFields,names,schema,operations,editmeta,changelog,versionedRepresentations","id":"1394850","self":"https://rndwww.nce.amadeus.net/agile/rest/api/2/issue/1394850","key":"HOM-1801","fields":{"customfield_13100":null,"fixVersions":[],"resolution":null,"customfield_10500":null,"customfield_12800":null,"customfield_12802":null,"customfield_12801":null,"customfield_10900":"2|i0aynj:","customfield_12804":null,"customfield_12803":null,"customfield_12806":null,"customfield_12805":null,"customfield_12808":null,"customfield_12807":null,"customfield_12809":null,"lastViewed":"2018-03-26T15:45:35.162+0000"... Be Assessed","id":"11"},"customfield_10100":null,"customfield_12400":null,"labels":["R&D","Rail","XPR"],"customfield_12401":null,"customfield_11700":null,"timeestimate":null,"aggregatetimeoriginalestimate":null,"versions":[],"issuelinks":[],"assignee":null,"status":{"self":"https://rndwww.nce.amadeus.net/agile/rest/api/2/status/3","description":"This issue is being actively worked on at the moment by the assignee.","iconUrl":"https://rndwww.nce.amadeus.net/agile/images/icons/statuses/inprogress.png","name":"In Progress","id":"3","statusCategory":{"self":"https://rndwww.nce.amadeus.net/agile/rest/api/2/statuscategory/4","id":4,"key":"indeterminate","colorName":"yellow","name":"In Progress"}},"components":[],"customfield_10210":null,"customfield_10211":null,"customfield_10203":null,"customfield_12503":null,"customfield_10204":null,"customfield_10600":null,"customfield_12502":null,"customfield_10205":null,"customfield_12505":null,"customfield_12901":null,"customfield_10206":null,"customfield_12504":{"self":"https://rndwww.nce.amadeus.net/agile/rest/api/2/customFieldOption/11557","value":"Pending","id":"11557"},"customfield_12900":null,"customfield_10207":null,"aggregatetimeestimate":null,"customfield_10208":null,"customfield_12902":null,"customfield_12506":null,"customfield_12905":null,"customfield_12904":null,"customfield_12906":null,"creator":{"self":"https://rndwww.nce.amadeus.net/agile/rest/api/2/user?username=yginestet","name":"yginestet","key":"yginestet","emailAddress":"yginestet@amadeus.com... GINESTET","active":true,"timeZone":"Europe/Berlin"},"subtasks":[],"reporter":{"self":"https://rndwww.nce.amadeus.net/agile/rest/api/2/user?username=yginestet","name":"yginestet","key":"yginestet","emailAddress":"yginestet@amadeus.com","avatarUrls":{"48x48":"https://rndwww.nce.amadeus.net/agile/secure/useravatar?ownerId=yginestet&avatarId=22906","24x24":"https://rndwww.nce.amadeus.net/agile/secure/useravatar?size=small&ownerId=yginestet&avatarId=22906","16x16":"https://rndwww.nce.amadeus.net/agile/secure/useravatar?size=xsmall&ownerId=yginestet&avatarId=22906","32x32":"https://rnd... GINESTET","active":true,"timeZone":"Europe/Berlin"},"customfield_12101":null,"customfield_12100":null,"aggregateprogress":{"progress":0,"total":0},"customfield_12103":"HOM-1800","customfield_10200":null,"customfield_12102":null,"customfield_10201":null,"customfield_12501":null,"customfield_10202":null,"customfield_12500":null,"customfield_11801":null,"customfield_11802":null,"customfield_11804":null,"progress":{"progress":0,"total":0},"votes":{"self":"https://rndwww.nce.amadeus.net/agile/rest/api/2/issue/HOM-1801/votes","votes":0,"hasVoted":false},"worklog":{"startAt":0,"maxResults":20,"total":0,"worklogs":[]},"issuetype":{"self":"https://rndwww.nce.amadeus.net/agile/rest/api/2/issuetype/6","id":"6","description":"gh.issue.epic.desc","iconUrl":"https://rndwww.nce.amadeus.net/agile/secure/viewavatar?size=xsmall&avatarId=12607&avatarType=issuetype","name":"Epic","subtask":false,"avatarId":12607},"timespent":null,"project":{"self":"https://rndww... Project","avatarUrls":{"48x48":"https://rndwww.nce.amadeus.net/agile/secure/projectavatar?pid=11902&avatarId=11701","24x24":"https://rndwww.nce.amadeus.net/agile/secure/projectavatar?size=small&pid=11902&avatarId=11701","16x16":"https://rndwww.nce.amadeus.net/agile/secure/projectavatar?size=xsmall&pid=11902&avatarId=11701","32x32":"https://rndwww.nce.amadeus.net/agile/secure/projectavatar?size=medium&pid=11902&avatarId=11701"}},"customfield_11000":null,"aggregatetimespent":null,"customfield_12602":null,"customfield_10700":null... Test Automation","customfield_12703":null,"customfield_10008":{"self":"https://rndwww.nce.amadeus.net/agile/rest/api/2/customFieldOption/10001","value":"To Do","id":"10001"},"customfield_10800":null,"customfield_12702":null,"attachment":[],"customfield_10009":"ghx-label-6","customfield_10801":null,"summary":"EPIC Test Automation","customfield_10000":null,"customfield_10001":null,"customfield_10002":null,"customfield_12300":null,"customfield_10003":null,"customfield_10004":"9223372036854775807","customfield_10400":null,"environment":null,"duedate":null,"comment":{"comments":[],"maxResults":0,"total":0,"startAt":0}}}

 

It seems that i should be {{issue.fields.customfield_12103}}, but it is not working.

Am i right ?

0 votes
David Willox March 26, 2018

Hi Yannick,

 You could use the Automation Lite for JIRA plugin. It's simple to set up and easy to use.

Dave

yannick ginestet March 26, 2018

I'm using it. 

In my case, i need to test and or access to Parent Link object, with a link store in a custom field.. but i do found the way to do it.

 

this is why i'm asking.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events