Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,463,739
Community Members
 
Community Events
176
Community Groups

How can one reach json content with smart values with Jira Automation on Server / DC

I would like to use the status category color of an issues status in an automation rule.

Interestingly {{issue.status.statusCategory}} results to this in the log:

StatusCategory{self='<base-url>/rest/api/2/statuscategory/4', id=4, key='indeterminate', colorName='yellow', name='In Arbeit'} 

But unfortunately it is not possible to get the colorName member. It'S an empty string if I use {{issue.status.statusCategory.colorName}}

Only key and name deliver the correct content. 

Is there any chance to get other items from those "json objects" with smart values?



2 answers

1 vote
Simmo Atlassian Team Aug 22, 2021

Hi @Christian Bär

I'm from the Cloud team, not the Server team. However, what I can see what the issue most likely is. We haven't exposed the ability to access the colorName field, only the name and key are accessible at the moment.

I'm afraid that this is beyond my control. I suggest that you open a support case and see what the server team can do. It shouldn't be a big job to open up access to the colorName field.

Cheers,

Simeon.

Hi @Christian Bär 

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

I find that some of the smart values can be dereferenced using dot-notation, while others need to be extracted using text/list functions, etc.  You could try that to see what is accessible.  Also, the exact path may be different to that field.  (Please see below.)

This could also be a difference in how that object renders in log versus what is available with smart values.  You may use the information in this how-to article to learn which smart values are available: https://support.atlassian.com/jira-software-cloud/docs/find-the-smart-value-for-a-field/

UPDATE: To save you some time, I do not think this will be possible with Jira Server using automation rules; you may confirm that with the support team.

I was able to get the color by first saving the statusCategory to a created variable, and then access the field with string functions.  This seems to indicate one or more of the values in that object is dynamically generated and so unavailable using the smart value syntax *unless* the statusCategory is captured first.  As created variables are not available in Jira Server that method won't help you.

 

Best regards,
Bill

Darryl Lee Community Leader Aug 19, 2021

Funny @Bill Sheboy - I was thinking the same thing - let's look at what the API has.

Thing is, it has does appear to have the field Christian is looking for!

"status": {
    "self": "https://jiradev.MYSITE.com:8443/rest/api/2/status/10604",
    "description": "RFC",
    "iconUrl": "https://jiradev.MYSITE.com:8443/images/icons/status_generic.gif",
    "name": "RFC",
    "id": "10604",
    "statusCategory": {
        "self": "https://jiradev.MYSITE.com:8443/rest/api/2/statuscategory/2",
        "id": 2,
        "key": "new",
        "colorName": "blue-gray",
        "name": "To Do"

    }

But yeah, I ran into the same thing as Christian. I could get key and name as smart values, but not colorName. Very odd.

Server doesn't have variables, but it does have issue properties. Alas, when I tried to set a property called "statusColor" to {{issue.status.statusCategory.colorName}}, it also came up blank. :-/

OH, I didn't try saving the whole object. Let's see... I tried setting an issue Property called statusCat. These all came up blank:

PropColor: {{issue.properties.statusCat.colorName}}
PropCatColor: {{issue.properties.statusCat.statusCategory.colorName}}
PropName: {{issue.properties.statusCat.name}}
PropCatName: {{issue.properties.statusCat.statusCategory.name}}

 But this "worked" in the same way the field value itself works:

Full prop: {{issue.properties.statusCat}}

Returned:

StatusCategory{self='https://jiradev.MYSITE.com:8443/rest/api/2/statuscategory/2', id=2, key='new', colorName='blue-gray', name='To Do'}
Very odd.
Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events