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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jul 10, 2018 in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

178 views 0 4
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