Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How would I get a value from a property using Automation for Jira

Jon Bartholomew
Contributor
March 4, 2019

I've tried following the help on getting values from properties, but failed to work out the correct format for getting a property with multiply values.

The value can be seen when using the following URL.
https://*****.atlassian.net/rest/api/2/issue/73304/properties/proforma.forms.i1

It's path, using JSONView, within this URL is:
value.questions[7].text

Does anybody know how to format the {{issue.properties}} smart-value to get at this property?

Any help is much appreciated.

 

3 answers

1 accepted

1 vote
Answer accepted
Jon Bartholomew
Contributor
March 6, 2019

I managed to find the solution with some help from the codebarrel support team.

{{issue.properties."proforma.forms.i1".questions.get(7).text}}

The quotes were the unknown bit, and the i1 is a dynamic reference to the form in the properties (incrementing number), but as long as we add our attached forms in the correct order we should be able to reference it.

Not perfect, but workable!

 

Some additional info:

I used the following URL to some the list of properties. I could then click on the property I was after and drill down through to find the individual elements required.

https://********.atlassian.net/rest/api/2/issue/ISD-99999/properties

Ben Rivera December 13, 2019

You are a life savor!!! I have been working on this for days. I was trying to use regex to get the data I wanted but this is so much cleaner. Plus the regex was not working at all.

0 votes
Deleted user March 4, 2019

Hey there Jon,

Unfortunately, getting out complex (ie. JSON objects) or lists from the properties in Cloud isn't supported at the moment. I've raised a ticket for it at https://codebarrel.atlassian.net/browse/AUT-1361

It might be a bit tricky since we don't know generically what type a property might be

Cheers,

Mark C

0 votes
Iago Docando
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 4, 2019

Since you only have problems when dealing with multiple values... Have you checked https://docs.automationforjira.com/working-with-issue-data/multi-value-fields.html#examples?

Jon Bartholomew
Contributor
March 4, 2019

Unfortunately not. The list functions do not appear to work on properties. I have tried many variations but with no success. Perhaps I am formatting incorrectly, but I cannot find any good examples in extracting values from properties. Thanks.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events