Jira automation to use reporter if assginee is empty

Mariam Mohamed
Contributor
March 9, 2025

I'm trying to create global automation rule and in this rule I will need to use the assignee email to send notification: {{issue.assignee.emailAddress}}. but in case the assignee is empty I want the automation rule to use the reporter email instead of the assignee: {{issue.reporter.emailAddress}}. The assignee and reporter could be different people and the notification should be sent to only one person starting with the assignee if the field is filled otherwise use reporter.

How can I achieve this? I tried the if/else block for when the assignee is empty but didn't know how to continue with the rule. any ideas?

 

As well I have general but very important question: since I'm creating a global rule I will need a unique identifier across all issues/tickets within jira (a unique id for issues across all projects). I need it in number format since I will be using it in the header of the 'send web request', so is the solution here to use {{issue.id}} ?

1 answer

1 accepted

0 votes
Answer accepted
Vishal Biyani
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.
March 10, 2025

@Mariam Mohamed 

You can create a smart Variable say varEmailAddress and populate it like this

{{if(exists(triggerIssue.assignee.emailAddress), triggerIssue.assignee.emailAddress, triggerIssue.reporter.emailAddress)}}

 

Then in email component use {{varEmailAddress}}

See the rule below

snip.png

Mariam Mohamed
Contributor
March 10, 2025

Thanks @Vishal Biyani it worked! this is exactly what I was looking for, really thanks..

as well in case you you can help me with the below question?

is issue id unique across all projects/issues in jira data center?

Vishal Biyani
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.
March 10, 2025

I have not worked on JIRA data center. I am using cloud instance.

Having said that, given that issue id is a key value, it should be unique across the projects in the same instance.

Like Mariam Mohamed likes this
Mariam Mohamed
Contributor
March 10, 2025

got it, thanks @Vishal Biyani 

Suggest an answer

Log in or Sign up to answer