What Do i have to write in the content field in the 'Send Email' last step of my automation ?
Asked by Eleftheria Sourla:

I want to create an automation in my projects and every time someone change the priority to **highest** and every time someone change the status to **escalated** an email should be sent to the Assignee , Watchers , The lead of the project , and a separate email address in the company.

I don't know how to set up the content for the email that will appears in the email that will be sent. I want it to be appearing like this .

Do i have to change the workflow or check the transition in there?

|---------|-------------------------|
|                                  ||
|                                  ||
|         |                         |
|         |                         |
| Status: | PENDING ALLOCATION Done |


Answers:
author: Jack Brickey
body: Hi [@Eleftheria Sourla](/t5/user/viewprofilepage/user-id/5402284) , if you wish to include the previous status then you will need to create a custom field where you can record this information in a separate automation rule. It would look basically like this.

rule 1 (creation):

* trigger - issue created
* action - edit issue, previous-priority equals {{issue.priority}}

rule 2 (updated):

* trigger - field update, priority
* action - send email, "the previous priority was {{issue.previous-priority}}}, "the new priority is {{issue.priority}}

comments: author: Eleftheria Sourla
body: Hey [@Jack Brickey](/t5/user/viewprofilepage/user-id/853369) thanks for the response , but I am not sure if I have understand the rule creation. About the rule 2 . First do i have to create the rule 1 and then i am gonna update the 1 and will be renames as rule 2? Also what about the escalated status ?


author: Jack Brickey
body: Hi [@Eleftheria Sourla](/t5/user/viewprofilepage/user-id/5402284) ,

sorry I was not quite clear and I forgot an important step in my second row, so let me try again.

* you need a custom field where you can record previous priority
* you need one rule that will initially set the value of your custom field. This will be done at issue creation.
* you need a second rule that will send your email and also (what I forgot.) update your custom Field

so here is the updated proposal...

rule 1 (issue creation):

* trigger - issue created
* action - edit issue, previous-priority equals {{issue.priority}}

rule 2 (updated priority):

* trigger - field update, priority
* condition - priority in (highest, escalated)
* action - send email, "the previous priority was {{issue.previous-priority}}}, "the new priority is {{issue.priority}}
* action - previous-priority equals {{issue.priority}}

I hope this makes sense. Please give it a try and if you get stuck post your two rules here so I can assess.


author: Eleftheria Sourla
body: [@Jack Brickey](/t5/user/viewprofilepage/user-id/853369) I have some questions . First of all where am i supposed to add the custom filed ?

Also

* trigger - field update, priority ( in my Jira version is called value chagned

i cannot add highest and escalated in the same condition , i have to crate a new one

And last one :

* action - send email, "the previous priority was {{issue.previous-priority}}}, "the new priority is {{issue.priority}}
* action - previous-priority equals {{issue.priority}} where am i supposed to fill in those 2 steps ? Am i going to add in the same rull 2 actions ? And is it possible to add and the comments of the ticket in the email step ???

Thank you so much for you help


author: Eleftheria Sourla
body: [@Jack Brickey](/t5/user/viewprofilepage/user-id/853369) ![Screenshot 2024-01-11 124426.png](https://community.atlassian.com/t5/image/serverpage/image-id/300055i6209B6A2168E8967/image-size/large?v=v2&px=999 "Screenshot 2024-01-11 124426.png")![Screenshot 2024-01-11 124406.png](https://community.atlassian.com/t5/image/serverpage/image-id/300057iA6357624B731BCE3/image-size/large?v=v2&px=999 "Screenshot 2024-01-11 124406.png")


author: Eleftheria Sourla
body: [@Jack Brickey](/t5/user/viewprofilepage/user-id/853369)

Here is my projects workflow if it needs any changes .

![Screenshot 2024-01-11 133741.png](https://community.atlassian.com/t5/image/serverpage/image-id/300066i448374AD2228B996/image-size/large?v=v2&px=999 "Screenshot 2024-01-11 133741.png")


author: Jack Brickey
body: Hi [@Eleftheria Sourla](/t5/user/viewprofilepage/user-id/5402284) ,

to create a custom field:

* click on the cog or sprocket in the upper right corner,
* select issues, and then custom fields in the side bar,
* in the upper right, click on the create custom field
* create a new text field
* you will be presented with the opportunities to associate the new field to one or more screen which you should do for the screen you currently use for editing your issues. It should be obvious but if not you can determine the screen being used under project \> project settings \> screens

now for automation rules, here is an example of "rule 2":

![IMG_5109.jpeg](https://community.atlassian.com/t5/image/serverpage/image-id/300073i5ECC0F26F7743810/image-size/large?v=v2&px=999 "IMG_5109.jpeg")  
in the above, you will see are use "previous priority" as my custom field however, you can name that field anything you want.

![IMG_5110.jpeg](https://community.atlassian.com/t5/image/serverpage/image-id/300075i65B5997003A429BD/image-size/large?v=v2&px=999 "IMG_5110.jpeg")

The above action is used to update your custom field. Please note that I don't have "previous priority" as a custom field so in my example I chose "my text".

I believe that rule 1 should be pretty straightforward, but if not, let me know. Finally, I have not tested this and so some tweaking may be needed to get the end result that you desire. Hopefully what I am provided here will get you going in the right direction. Keep me posted.


author: Jack Brickey
body: oh, one of the thing, my example does not exclude the scenario where someone changes from highest to escalated, or vice versa. I am unsure what you would want to happen in that scenario. If you wanted to exclude that from the rule being executed, then a slight change would be needed, specifically you would need to add a condition that verifies that the previous priority, was not one of highest nor escalated. However, if you would want the rule to execute and send the email, then no changes would be needed.


author: Jack Brickey
body: and at the risk of rambling on...

if you don't really need to express the previous priority in your email, then you don't need any of that complexity of custom field and such. You could simply use something like the following single rule. Of course, add the action to send the email, but he would only indicate what the new priority is in your body not the previous.

![IMG_3434.jpeg](https://community.atlassian.com/t5/image/serverpage/image-id/300080i08373BB58D3351DF/image-size/large?v=v2&px=999 "IMG_3434.jpeg")


author: Eleftheria Sourla
body: [@Jack Brickey](/t5/user/viewprofilepage/user-id/853369)

Jack i will try those steps tomorrow and will keep you updated but the point is that I need to create 2 deferent rules one for the escalated status i mean when the status from any other status changes to escalated and another one for priority change to highest


author: Jack Brickey
body: I'm not sure why you would need separate rules for the two different priorities. I must be missing something in your requirements. Even if you need to send a different emails based on the loose priority, you could do that in Rule 2 by adding an, if else condition... if priority = highest then send highest email, else send escalated email.


author: Eleftheria Sourla
body: [@Jack Brickey](/t5/user/viewprofilepage/user-id/853369) Maybe I haven't understand how it needs to be done and I thought it must be in separate rules .

To concluse , I want a rule that will inform via email the assignee , the watcher and the leader of the project (i don't know if it is possible) and the email will be send to them when the ticket changes to priority highest or when the ticket goes to escalated status . My problem is that i don't know how to "print" this thought the email I want to be sent . I want something like this

![hti.png](https://community.atlassian.com/t5/image/serverpage/image-id/300216i0E46E2B8B444FA4F/image-size/large?v=v2&px=999 "hti.png")

But to inform you this form is used by a project that is service management . The projects i want to apply my rule is company managed business .


author: Eleftheria Sourla
body: [@Jack Brickey](/t5/user/viewprofilepage/user-id/853369)

I am not sure but i think i have find the source that i have to change in case to create the kind of rules i want but i dont know the right way .If you have any idea let me know .![Screenshot 2024-01-12 102734.png](https://community.atlassian.com/t5/image/serverpage/image-id/300241i8AC19FA4332EC1CA/image-size/large?v=v2&px=999 "Screenshot 2024-01-12 102734.png")


author: Jack Brickey
body: Hi [@Eleftheria Sourla](/t5/user/viewprofilepage/user-id/5402284) ,

let me step back because I feel as though I am off track.

by design Jira sends notifications when an issue transitions to a new status to all parties associated with the issue in question. This includes the assignee, the reporter, and all watchers. Is this not happening? You mention that you want to notify the assignee, the watchers and the project lead. by default, the project lead is not notified on every issue. for that to happen, the project lead would have to be a watcher of each issue (or of course they could also be the assign or reporter).

If users are not seeing notifications, can you check the Notifications settings under project settings? Also the user has personal settings that could override the project settings.


author: Jack Brickey
body: Also, please note that you will not be able to achieve the precise formatting that you are illustrating in the body of the email. You can certainly indicate the same information by simply saying **previous status was** and **new status is** or whatever text you desire.


Tags: cloud

jira-work-management-cloud