Forums

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

Populating assignee field from certain text in the description field

Jane Smith March 2, 2023

Hi, 

If I have a Jira issue (task) "Issue1" with a Description "testdescription Assignee: Jane Smith", how do I populate the Assignee field in the Jira task from my description?  

I tried doing

{{issue.description.substringAfter("Assignee: ")}}

and it didn't work - what might be going on here?

2 answers

0 votes
Mikael Sandberg
Community Champion
March 2, 2023

Hi Jane Smith,

Welcome to Atlassian Community!

The assignee field is expecting the Atlassian Id of the user that should be the assignee, so using {{issue.description.substringAfter("Assignee: ")}} would only get the name of the user. You would then have to search your users via the Find user endpoint in order to get the Atlassian Id and then set the assignee.

Jane Smith March 2, 2023

right, that helps with identifying the problem, thanks!

would something like the below work in the rule JSON though? I'm trying to avoid writing a lengthy python function just to retrieve the user ID

{{assignee.displayName}} = {{issue.description.substringAfter("Assignee: ")}}

0 votes
Florian Bonniec
Community Champion
March 2, 2023

Hi @Jane Smith 

Are you using the cloud version or data center version ?

 In your example, Assignee seems to be the display name of the user, I think it may work only if you have the username here.

 

Regards

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events