Forums

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

Setting assignee based on issue description

Jane Smith March 8, 2023

I'm working on a Jira automation rule where I'm trying to grab the assign the user to a task based on a task description. I first grab the substring from the description, and that substring contains the assignee display name as it appears in Jira. However, when I try to assign that string to the displayName attribute, nothing happens. 

Could someone please help me work through this?

 

In the JSON box under "More options" in the rule configuration, I have the following right now:

{

"fields": {

"Assignee":[{"displayName":"{{issue.description.substringAfter("Assignee: ")}}"}]

}

}

1 answer

1 accepted

3 votes
Answer accepted
Mikael Sandberg
Community Champion
March 8, 2023

You need to use the Atlassian ID for the assignee field, so you would have to use the web request component to send a request to either Get account IDs for users or find users and then get the ID from the result. Your JSON should look something like this:

{ "fields": { "assignee": { "id": "{{webhookData.accountId}}" } } }

Sergiu Noaghea
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!
March 22, 2023

I just want to give you a thumbs up, your reply re using the rest api to fetch user id helped out with my automation rule dilemma immensely ! 

Thank you

Like Mikael Sandberg likes this
Marc Isikoff
Contributor
October 18, 2023

Trying to do similar by setting the trigger issue's assignee to the one found in branch jql (yes, will always find one).

{ "fields": { {{triggerIssue.assignee}} : { "id" : {{issue.assignee.accountId}} " } } }

is invalid JSON

I'm sure I'm fairly close but trying to get this to work on assignee seems different from custom fields which is usually the example and questions here.

Mikael Sandberg
Community Champion
October 18, 2023

@Marc Isikoff You cannot set the trigger issue's assignee in a branch, you can only edit the branch issue.

I would break that part out so you have two automations. The first one would do a web request to the second automation with the key to the trigger issue and the assignee that you want to set.

Marc Isikoff
Contributor
October 18, 2023

Actually you can and I just tested it:

Use standard automation (e.g., not branching) of edit issue, assign issue and use copy from another issue -> JQL Issue -> You JQL statement

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events