Script Listener - Append Linked Issue to Comment

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

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

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')

-----------

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

364 views 0 6
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you