Forums

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

How to create a email trigger when a transition is moved

kanaka prasad ponnuru
Contributor
December 23, 2021

Hi Team,

I have a requirement that I have two statuses called Pre-milinary and Active and I have a user picker field called Approver.

When my status is moved from Pre-milinary to Active according to approver list users get notified (via email) that this ticket is waiting for your approval.

I want to achieve this via script runner but I am not good with groovy scripting. Can someone help me out with a sample script so that I can edit according to my requirement?

Your help on this much appreciated. Thanks in advance.

Regards,

Kanaka.

2 answers

1 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
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.
December 24, 2021

I think https://library.adaptavist.com/entity/send-custom-email is probably most of what you need.

kanaka prasad ponnuru
Contributor
December 25, 2021

Thanks for the response.

I will try to modify this script according to my requirement and will let you know if I face any issues.

Regards,

Kanaka

kanaka prasad ponnuru
Contributor
January 4, 2022

Hi,

I hope you are doing great!

I have tried the script which is given by you and it is executed successfully.

Thanks for the script. I have a request that for test purpose I have given my email id at the end, but the problem here is we have many approvers to be included in the script adding to the users and removing the users IDs everytime is not a good practice.

So I want to add "Approver" field in the script so that email will be sent according to the Approver field list. So how can I Modify the script according to my requirement?

Regards,

Kanaka

Nic Brough -Adaptavist-
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.
January 4, 2022

Hmm.  Assuming your approvers are service-management approvers, then you could combine the email script send with https://library.adaptavist.com/entity/get-email-address-of-approvers

kanaka prasad ponnuru
Contributor
January 5, 2022

Hi,

Nope, my approvers are not service-desk approvers.

I just want to add something here that how can we get the issue I'd everytime whenever a transition is done?

Regards,

Kanaka.

0 votes
Pramodh M
Community Champion
December 23, 2021

Hi @kanaka prasad ponnuru 

Why Scriptrunner?

You can achieve this via Custom events.

Create a custom event and add the relevant people to Notification Scheme.

Add the Event in Workflow Transition from Pre-milinary and Active to trigger the Notification to the users you have specified in Notification Scheme.

Thanks,
Pramodh

kanaka prasad ponnuru
Contributor
December 24, 2021

Hi Pramodh,

Actually our client is more preferable to script runner. Is it not possible to achieve this via script?

If we can achieve this via custom event would  you be able to  give the detailed steps?

Regards,

Kanaka.

Suggest an answer

Log in or Sign up to answer