The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Get value of the Insight attribute by its ID for Jira Automation

Olena Kharchenko
June 17, 2021

I am setting an automation to calculate the value of one Insight attribute depending on values of two other attributes of an Insight object. I can get the values without a problem using the name of the attribute, like {{issue.fields.customfield_10166."Budget planned"}}

The problem is that I renamed the Insight attribute and the system does not get the value by the new name (nor by the previous one), which in my opinion is a bug. The attributes which were not renamed work fine.

Now I know the attribute Id is 254, but I don´t know the syntax for it in smart values. For JSON I found objectTypeAttributeId ==264, which is nor working with smart values.

Could you help me to find an expression to get the attribute value by its ID not by its name?

Thank you in advance!

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Alain Chartier
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 19, 2021

Hi @Alex van Vucht (GLiNTECH) 

 

You're right, the Insight objects in smart values are very tricky to work with!  With Automation for Jira, I try to extract data from an Insight attribute and put it in a custom field in Jira.  Unfortunately, the proposed formula always returns no value.  

 

The formula used is {{#issue.fields.customfield_39500.attributes}}{{if(typeId.eq(569),values.get(0).displayValue)}}{{/}}

 

I only changed the customfield number (39500) and the typeId.eq (569) in your proposed formula.

 

Do I have to set something else in the formula to make it work?

 

Thanks a lot in advance for your help!

 

Alain

0 votes
Alex van Vucht (GLiNTECH)
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 Champions.
June 17, 2021

Yes, Insight objects in smart values are a little tricky to work with. I've done a deep dive for another purpose and using some pretty sophisticated Smart Values expressions, this is actually possible.

Try:

{{#issue.fields.customfield_10166.attributes}}{{if(typeId.eq(264),values.get(0).displayValue)}}{{/}}

I hope these new features get documented soon.

TAGS
AUG Leaders

Atlassian Community Events