Scriptrunner Trigger notification to JIRA/Non JIRA Users on comment of issue only at specific status

Steven Lloyd April 2, 2019

We are looking for the ability to create a notification to both JIRA and non JIRA users when a comment is made during a specific part of a workflow. It doesn't matter who makes the comment, but just that is it updated at a specific state. 

We do not have JIRA Service Desk so Automation on comment to trigger a notification is not possible, but is this something that could be potentially acheieved using ScriptRunner?

Cheers

 

Steve

2 answers

1 accepted

1 vote
Answer accepted
Joanna Choules
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.
April 4, 2019

Hi Steven,

What kind of notification do you want to provide? For an email notification you can use the 'Send a custom email' scripted listener.

Yours,

Joanna Choules, Adaptavist Product Support

Steven Lloyd April 4, 2019

Hi Joanna,

Thank you for your response,

Basically we are looking for an email notification, but solely on a comment at specific status, not on a transition of a status, so would this be inline with "Sending an email from an non-issue event?

Cheers

Steven

Steven Lloyd April 4, 2019

Thinking about this further which could potentially be easier, because we have users who do not have the "transition" permission, does script runner have the functionality to transition on a comment, rather than trigger an email. If we were able to use Scriptrunner to be able to transition once a comment has been added, we could use a notification scheme on the transition.

We do not have the automation that comes with JSD, so this is a workaround of that.

Cheers

Joanna Choules
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.
April 4, 2019

Hi Steven,

Yes, you could use a fast-track transition listener to transition the issue in response to an Issue Commented event.

Joanna

Steven Lloyd April 4, 2019

Hi Joanna,

Thank you, this looks like the thing I was looking for, I can't see transition on a comment though, I have gone through the examples on the post function and the document sent but still unfortunately unable to clarify it.

Steven

Joanna Choules
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.
April 4, 2019

Hi Steven,

Fast-tracking is available as a listener as well as a post-function - in this case, the listener version is the one you want. When configuring the listener, you can select the events it should trigger on in the Events field of the config.

Joanna

Steven Lloyd April 4, 2019

Afternoon,

We have ran through and tried to create it in the Listeners for "Send a custom email", going back to the original query I had, rather than transition.

Event - Issue Commented

Condition and Config

issue.getStatus() == "Information Received"

 --------------------------------------------

We are getting no failures on the executions, however we are not receiving the triggered emails, Can you see anything wrong with this?

Cheers

Steven

Joanna Choules
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.
April 4, 2019

Hi Steven,

issue.getStatus() returns a Status object rather than a String, so comparing it with a string will always produce false. You can use issue.getStatus().getName() to get the human-readable name of the status as a string.

Joanna

Steven Lloyd April 4, 2019

Perfect!!!!

Looks like we have been able to cover everything off. Thanks for your help on the issue.

Steven

Steven Lloyd April 5, 2019

With regards to the Email Template field, we have had a look and are looking to general the email template with;

  • Assignee
  • Comment
  • Comment Made by
  • Due Date (Custom Date field)

However at the minute we are just retuning errors, do you have any additional information around this?

Steven

Joanna Choules
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.
April 5, 2019

Hi Steven,

This is probably better served at this point by raising a support ticket - please include as much detail there as you can about what specific errors you're encountering.

Joanna

Steven Lloyd April 5, 2019

Joanna,

I have raised SRJSUP-8126 as per the request.

Thanks for you assistance with this

Steven

0 votes
Steven Lloyd April 4, 2019

.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events