Script Listener - Append Linked Issue to Comment

Anthony Cardone September 28, 2017

Hello, 

We are making a standard service desk portal for internal requests, which then get auto-routed to the appropriate development projects. Since linked issues don't show in the Service Desk Portal, I want to surface the linked issue in an auto-generated comment.

I'm using one listener to clone the issue to the right projects, and another to close the original issue and add a comment.

I have a fast-track transition listener, on issue-created event closing the ticket with this additional action:

issueInputParameters.setComment('This is a help desk copy of your ticket, and has been closed. Click on ABC-123 to go to your actual request in the appropriate team's backlog')

How do I get ABC-123 to render the actual linked issue #?

Thank you!

1 answer

0 votes
Thanos Batagiannis _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.
September 29, 2017

Hi Anthony, 

I suspect that this is happening because you have two listeners trigger for the same event, and you can never be sure about the order that they will execute.

A workaround will be to use the Clone an Issue an link in a post function and keep the listener you have for the fast track. This way you are sure for the order that the automations will happen (the one in the post function will be first and the event will follow)

Pleas let me know if this does the trick.

Kind regards, Thanos

Anthony Cardone September 29, 2017

Hi Thanos, I have them fire on different events so the order of operations is working OK.

What I'm trying to figure out is how to update the code below to actually call the linked issue ticket#, instead of just a placeholder

-----------
issueInputParameters.setComment('This is a help desk copy of your ticket, and has been closed. Click on (INSERT LINKED ISSUE NUMBER HERE) to go to your actual request in the appropriate team's backlog')

-----------

Anthony Cardone October 8, 2017

Hi Thanos, What I'm hoping to do is put a ticket's related link in a comment on the ticket. Can you help me with this?

Thank you!

-Anthony

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events