Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Using smart values to get status color

Using 'Automation for Jira' version 7.3.3 and I'm trying to get the status color.  According to the following article: https://blog.codebarrel.io/how-to-use-smart-values-in-automation-for-jira-15edddfb8c7c it says that we can get to any attribute following the JSON representation.  So I used the JIRA REST API and was able to see that the statusColor is an attribute in the JSON but when I try and get it back using smart values, I don't get anything.

If I try the following: {{issue.status.statusCategory}}, I get back the following: StatusCategory{self='https://<jiraUrl>/rest/api/2/statuscategory/4', id=4, key='indeterminate', colorName='yellow', name='In Progress'}

I then tried the following: {{issue.status.statusCategory.colorName}} and don't get anything back.  Not even an error.  Is there a limit to the number of indirection that we can do in a smart value?  Am I missing something?

Thanks for your help and time!

Luc

1 answer

Hi @Luc 

Full disclosure, I am using Cloud and not Server version of Jira... 

What problem are you trying to solve by capturing the color?  Or is this more a general question about the level of available dereferences in the smart values within automation?

 

For the symptom you observed, this behavior is a known issue and appears to be considered a "documentation problem": https://codebarrel.atlassian.net/browse/AUT-2065

With cloud automation rules, I noted:

  • {{issue.status.statusCategory}} appears to return a JSON object array, and only the name attribute could be dereferenced within a rule.  However the asJsonObjectArray function didn't work either.
  • All other attributes returned null, except...
  • when I used the Cloud action of create variable to first store the value; then I was able to parse out the color using string functions as type-casting appeared to happen:
    • {{varStatusCategory.substringAfter("colorName='").substringBefore("'")}}

So one work-around to try would be to save the value in a text custom field first, re-fetch, and then try to parse it as a string.

Best regards,

Bill

Thanks for the info @Bill Sheboy !  Unfortunately, the 'create variable' is only available in the Cloud version and not in the Server version so this option won't work.

The reason I need the status color is that I'm sending an email that contains an HTML table.  I'm trying to set the background cell color based on the status color.  I've gotten around it by doing 2 different rules but was curious as to why I couldn't get the value and save myself 2 rules.

Luc

Like Bill Sheboy likes this

Thanks for explaining.  How about this work-around: add a custom field like StatusColor, and set it (hard-coded) whenever an issue transitions.  Then you can use the color in your HTML table when needed in other rules.

__Bill

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.13.18
TAGS

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you