Setting an assignee through json

Chris Carpenter
Contributor
November 6, 2024

 

 

Im trying to set an assignee via json with a rule and running into an interesting issue. Here's my json

{
"fields": {
"assignee": { "id": " {{triggerissue.issuelinks.get(0).outwardIssue.assignee.accountId}}" }
}
}

Im grabbing the user ID form the assignee of a ticket that the issue I just created is linked to. I have a log in my automation rule to verify that I am getting the proper account ID. But when the rule runs, I see the following error:

Error editing issues
EGT-8211 (Specify a valid value for assignee (assignee))
Tried using both name and ID in my json already. Thought this might be a permissions issue, but automation for jira has full project permissions

Any thoughts?

1 answer

1 accepted

0 votes
Answer accepted
Bill Sheboy
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.
November 6, 2024

Hi @Chris Carpenter 

I have observed evaluation-order problems with JSON in the advanced edit for rules, where some smart values are not fully evaluated before the JSON is captured for usage.

If you have confirmed that expression works using an audit log write, I recommend pre-building the JSON in a created variable and then using that variable as your JSON.

 

Also, smart values are name, spacing, and case-sensitive.  The one for the trigger issue is {{triggerIssue}} so I recommend also correcting that.

 

Kind regards,
Bill

Chris Carpenter
Contributor
November 6, 2024

Oh geeze, goot catch on the trigger issue. Thanks!
Gave your suggestion a go and pre-built the json in a variable, and wound up getting the same error unfortunately 

BUT I tried just setting the assignee of my issue with the assign automation action, and using the triggerIssue smart value now that's its spelled correctly, and that worked like a charm. Thanks!

Like Bill Sheboy likes this

Suggest an answer

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

Atlassian Community Events