Forums

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

How to automate an email when issue is FIRST assigned

Suzanne Green November 24, 2022

I want to send an email when the issue is assigned for the first time only.  When the ticket goes from unassigned to assigned.

Most automation triggers are going to resend the email (action) every time the assignee changes.  I only want it to occur the first time when it goes from unassigned to assigned.

2 answers

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 24, 2022

Hi @Suzanne Green -- Welcome to the Atlassian Community!

There are at least two ways to do this, depending on this question: do you expect issues ever to be unassigned after first assigned?

If the answer is "no", using the issue assigned trigger, you could use a condition to check change log and only proceed if the "from" value was unassigned (i.e. empty).

If the answer is "yes", you need a way to preserve/save that the email was sent.  That could be done with a comment, custom field, or issue property.  Once the value is set a condition could be used to check before proceeding.  This method isn't tamperproof either, as the indicator could be altered too.  I believe the only tamperproof way is to call the REST API and check the history to confirm the assignee has not been set previously.

Kind regards,
Bill

Suzanne Green November 24, 2022

Answer is "No" and your solution sounds like what I am after.

However I am VERY new to Jira.  Do I use a issue filed condition, in which case it doesn't seem to have or accept or do I use a JQL condition, in which case what string do I use?

{{changelog.assignee.from}}

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 25, 2022

Please try the Issue Assigned trigger, and try the fromString with change log.  "from" will be the entire object and that may be more difficult to compare to

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/#--changelog--

So the rule could be something like this:

  • trigger: issue assigned
  • advanced compare condition: checking if {{#changelog.assignee}}{{fromString}}{{/}} is empty
  • action: send your email
Like # people like this
Suzanne Green November 27, 2022

Thank you very much that's perfect.

And that answers so many follow up questions I had such as "are the changelog created by default or do I need to make them".

Like Bill Sheboy likes this
0 votes
Lynne Ratcliffe
Contributor
November 24, 2022

In your JQL can you add “assignee is empty” as one of the conditions?

Lynne Ratcliffe
Contributor
November 24, 2022

Or assignee = unassigned

Like Suzanne Green likes this
Suzanne Green November 24, 2022

Thank you for your response.  The trigger is the value of assignee changes and therefore the assignee is not empty or unassigned at that stage.
I can't find a way to make the trigger from unassigned to assigned.

Like Lynne Ratcliffe likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events