Forums

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

Help with automation rule using advanced issue edit JSON

Josh Cabrera
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!
January 18, 2024

I inherited automation rules from someone no longer at the company, and I only know the basics of JSON.

The rules are a mess and errors are logged 50% of the time, so I'm trying to clean them up.

My biggest problem at the moment is that I don't understand a particular component of the rules.

If I understand correctly, the previous component is looking up objects and retrieving the "ItApproverUserNames" attribute/field value, which is an array of users.

Looking at the block below, which is using the Edit issue fields action with the advanced or additional fields option - can anyone help me understand what "first" is doing after "ItApproverUserNames"?

Is it simply making sure it fetches the values from the first array item? If so, isn't that unnecessary - i.e., shouldn't it default to that if not specified?

{
"fields": {
"IT Approval": {{lookupObjects.ItApproverUserNames.first.asJsonObjectArray("id")}}
}
}

 

1 answer

1 accepted

0 votes
Answer accepted
Kai Becker
Community Champion
January 18, 2024

Hi @Josh Cabrera 

welcome to the community and thanks for your question.

To better understand your problem and the rule, could you please post a screenshot of the rule and the attributes of the object?

Josh Cabrera
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!
January 18, 2024

Thank you, Kai.

I ended up rewriting the rule entirely and resolved my issue.

The issue was very poor logical flow of the components and had nothing to do with the JSON that I was concerned about.

Appreciate your help!

Like Kai Becker likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events