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}} ?
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
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.