I want to leave a comment to inform the reporter of linked issues.
Something like:
Hello, your issue has been moved to another project's backlog. Please follow all future progress in issue _______.
Where ________ is an existing linked issue to the current issue where the comment is being left.
I have tried many smart values but am striking out. Please help! :)
Hi @Ryan Gill ,
to really find a solution that matches exactly your needs please specify your use case in more details and from a functional perspective.
Best
Stefan
Hello Stefan
Here is my use case:
I have a Jira Service Management project which is being used to triage issues before sending them to other projects.
There are workflow transitions that contain a post-function that use Jira Misc Workflow Extensions to create a new issue in another project, and link the new issue to the existing service management issue.
Once the transition to the "Send to Project X" status is done, there is a Jira Automation rule set to update the status of the issue in Jira Service Management to be "Sent to another project" (status type: done/green).
I want, via Jira Automation, for a comment to be left on the Jira Service Management issue, where a message informing the reporter of the Jira Service Management issue that their issue has been triaged and transferred to another project, and inform them of the new key of the issue where they can follow future work on their request by a development team.
Thank you for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ryan Gill
As far as the linking is already made by the workflow post-function the automation rule only needs to react to trigger of "issue linked". This will also take the source issue into context (which as far as I got it right will be your Service Management issue). The destination issue in this case is the newly created issue (see inward-outward link description). Therefore the following rule should do the expected work (just took the problem/incident linking, that needs to be configured according your requirements/linking types):
Please keep in mind to configure the rule as multi-project or global rule as it is considered to operate in more than 1 projects.
Best
Stefean
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Stefan Salzl , this worked perfectly!
I made it a global rule, but added an if condition to make it apply to a single origin project for the time being. Thank you very much.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm probably just going cross-eyed but I got this to work but only in the wrong direction. So when I linked and issue on my JSM project, the comment that got created went on the issue created in the Jira project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Noel Ransom
it deoends on the link-direction. Each Link type has an inward and an outward link.
Please see my answer from march 13th. There is also a link describing this feature.
Without knowing any details/link types regarding your situation I guess you would like to have the comment in the destination issue. therefore I would recommend to add a „destionation issue branch“ and then add the comment action i your rule.
Best
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Stefan - I want the opposite. I have a service desk ticket that I then link to a Jira and i want the service desk ticket to have the comment showing the link to the Jira. I can only seem to get the comment to land on the Jira, not the service desk. I have to do this on a global automation which makes it hard (for me) to figure out how to tell it to do that. The comment appears with the right info on it, just not on the right issue!
I'm not sure if it matters but I set the automation to fire regardless of the issue link type and I would prefer to keep it that way. The automation picks up the rule properly, generates the right comment details but only puts the comment on the issue I link TO.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The action is "Comment on Issue", but i see NO way to control the difference between commenting on the originating/source issue and the "destination issue other than the smart values in the comment itself. This is driving me crazy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Noel Ransom
could you please share a screenshot of your rule the its components details?
Furthermore:
How are those issues linked? What is the link type how issues get linked from ServiceManagement to Jira? As you are trying to automate it this needs to follow a repeateable and clear process.
furthermore:
Did you read the link provided above regarding inward- and outward link? It dependes on where which issue link type goes. eg:
Let´s say we have
So it makes a difference if you say
Those things need to be clear defined as this will have an impact on where your automation rule decides to post the comment.
Link types and description are configured in the administration cosole - Issues - Issue linking:
Best
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is a screenshot. I do understand the outward/inward distinction and that makes perfect sense for the comment that is generated, when I use destination it properly references the issue I created the link TO. When I use source it's the reverse. But when my only choice on action is "Comment on Issue" I'm not sure how to designate which issue to comment on. In your example above, I want the comment to always go on ITSM-1 when I link an issue.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Noel Ransom
there is a specific branch type that says „destination issue“.
Use this branch instead of the „linked issue“ branch.
Best
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Eureka! Thank you so much! I knew it was something ridiculously simple.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @ryan
The other commenters here have left great suggestions which you can explore. One other method is to use the smart value `{{issue.issuelinks}}`. This provides a list of the issue links on an issue you can use in smart values. For example, the smart value
`{{#issue.issuelinks}}{{type.name}} - {{inwardIssue.key}}{{/}}`
Will print out:
<issue type> - <issue key>
for each link on your issue. In your case, you may want to filter the issue links down to just the one which is type of "Moved to" or whatever the name is of the link. In that case, you could use smart value
{{#issue.issuelinks}}{{if(equals(type.name, "Moved to"), inwardIssue.key)}}{{/}}
This will filter down the issue links to just the issue key of the linked issue, just replace the "Moved to" to the name of the link type. Depending on how the link was created, you may need to replace the inwardIssue to outwardIssue, if you are seeing the wrong issue key being displayed.
Hope that works for you!
Cheers,
Sam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sam, I got Stefan's suggested approach working nicely, I will keep this in mind for future iterations
Thank you for your response!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I used Sam's method for an automation when we add a link to an issue in a duplicate situation. For our use case if issue A and B are duplicates and issue B has a link added to issue A with link type "duplicates" the automation adds a comment on issue B informing the user that it's a duplicate of issue A. This was the smart value code I used and it worked great. Thanks, @Sam Harding for pointing this out. I had not seen details about this smart value in the documentation.
{{#issue.issuelinks}}
Key: {{outwardIssue.key}}
Reporter: {{outwardIssue.reporter.displayName}}
Summary: {{outwardIssue.summary}}
Description: {{outwardIssue.description}}
{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ryan Gill - First, be sure to consider that if your linked issues are on another project, you'll need to expand the rule scope to include those projects. Here's how I'd handle it:
Perform a Lookup Issues action with the following query:
Issue IN (linkedIssues({{issue}}))
Then use {{lookupIssues}} in your comment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.