When a ticket is assigned to a user, send a email like below. If the ticket got unassigned also this should work. Can anyone help me fill the "?" with smartvalues? I have tried multiple values, none of them working as expected.
Mail:
To: old and new assignee ?
CC: assignedby ?
Hello,
The assignee for issue {{issue.key}} ({{issue.summary}}) has been changed.
Old Assignee: ?
New Assignee: ?
Assigned by: ?
Issue Link: {{baseUrl}}/browse/{{issue.key}}
Regards,
Aravindh P
Hi @Aravindh P,
You would first need to create a Field value changed trigger and start looking out for any changes to Assignee field and use below template for Send email action.
To: Assignee (from dropdown)
CC: {{initiator.emailAddress}} (smartvalue)
Hello,
The assignee for issue {{issue.key}} ({{issue.summary}}) has been changed.
Old Assignee: {{fieldChange.fromString}}
New Assignee: {{fieldChange.toString}}
Assigned by: {{initiator.displayName}}Issue Link: {{issue.url}}
Regards,
Aravindh P
Fetching email address for previous assignee is not easy and you could use Jira API to fetch the details as described in this article.
You would need to add another action, Send web request, before sending the email,
Request URL: https://<yourinstance>.atlassian.net/rest/api/3/user/search?accountId={{fieldChange.from}}
Headers:
Authorization: Basic <base64_encoded_api_token>
Content-type: application/json
HTTP Method: GET
Web Request body: Empty
Delay execution...: checked
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Aravindh P
New Assignee: {{issue.assignee.emailAddress}}
Assigned by: {{initiator.emailAddress}}
Also. in Issue Link you can simply use {{url}} instead of what you wrote.
as for Old Assignee, there isnt a straight forward method to fetch it as the trigger will run the automation only post change.
so i would suggest to add a user picker custom field and create an automation that when ever the assignee field is changed, it will copy the value to that field and so you can combine it in the same automation you have and then use {{issue.Custom Field.emailAddress}} for the Old Assignee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did you try it?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi arielei,
New Assignee: {{fieldChange.toString}}
I have used the above line in the email component, and it worked. Thanks!
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.