JIRA CLOUD - How to send custom Alerts. UserMessageUtil for Cloud?

Roberto L
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.
July 22, 2021

Hello Community,

Thank you for taking the time to look at my post!

I am working in JIRA CLOUD and I would like to create a custom Alert that will be execute when an issue is updated (I am using a Listener).

The use case is:

User updates a certain field. This triggers an issue update even which is captured by a listener I created. This listener has code that will transition the issue from X to Y status (this works fine).

My gap is:

When the transition code runs in the listener I will check for a status code of 204 (success). If this statement is true then I want to add code that will display an Alert with a custom message "Your issue was transitioned from status X to Y because of _____".

In JIRA Server/DC you can use UserMessageUtil for the above but for CLOUD I cannot find a similar library.

Does anyone have any insight on how I can add this functionality into my Listener code.

Thank you!
-Roberto

2 answers

1 vote
Amirul _Adaptavist_ July 31, 2021

Hi @Roberto Luces ,

I can confirm that there is no way to display a popup dialogue showing when listener are being triggered with ScriptRunner for Jira Cloud as Atlassian does not provide any Rest API's for displaying popup dialogues and ScriptRunner for Jira Cloud can only use the Rest API's which Atlassian provides.

However, you could work around this by having your script call the Add Comment API to add a comment when the listener triggered and I can confirm we have an example of using this API here which can be used as a reference to see how to use this API.

Alternatively, you could work around this by having your script call the Send notification for issue API to to notify via email and I can confirm we have an example of using this API here.

I hope that answered your question.

Regards,

Amirul

Stan Dalenc April 13, 2023

look forward for this solution when APIs are available

0 votes
Liam Green
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.
July 30, 2021

Hi @Roberto Luces 

Is there a reason you don't want to use Automation to do this?

Thanks,

Liam

Roberto L
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.
July 30, 2021

Hello @Liam Green ,

No specific reason as to why Listener over automation other then the existing functionality I mentioned above might expand further in the same listener and I wanted to see if there is something like UserMessageUtil that I can add to other ScriptRunner scripts as well.

If I may ask, how would you achieve the above using Automation?

Thank you,

-Roberto

Suggest an answer

Log in or Sign up to answer