I need to add a comment to both the triggerissue and the destination issue, if a link was added to a jira in maintenance mode.
I was able to add a global automation rule:
"When Issue Linked
For Destination issue
if status equals Maintenance
then Add comment to issue"
Works great!
But if I also add Another For under When Issue Linked:
"For Linked issues
if: Status is one of maintenance
Then: Add comment to issue"
That only adds another comment to the same issue, even though it's under the "when Issue linked" section.
How do you add a comment on the triggerissue?
Hello @Alicia Pena
When you are using the Issue Linked trigger the rule recognizes two issues; the "source" issue and the "destination" issue. The "source" issue is the one that triggers the rule. Determining which issue is the "source" and triggers the automation vs. the issue that is the "destination" depends on which issue gets the Inward Description vs. the Outward Description for the link.
If you are putting the same comment on both issues then the structure of your rule would be:
TRIGGER: When issue linked
BRANCH: For Destination issue
CONDITION: If Status = Maintenance <<<this applies the condition to the other/destination issue in the linked pair
THEN ACTION: Comment on Issue <<<this adds a comment to the other/destination issue in the linked pair
CONDITION: If Status = Maintenance <<<this applies the condition to the trigger/source issue
THEN ACTION: Comment on Issue <<<this adds a comment to the trigger/source issue
I tested this in Jira Cloud, but I would expect it to work in Jira Server/DC also.
Thank you. I'm not on cloud and the comments will be different. Trying to figure out how to have two separate comments, one for source and one for destination.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can still have two different comments.
You just need to make sure you understand which issue will be considered the "source" (trigger) issue vs. the "destination" issue.
Are you going to do this for just one link type, or will it be for multiple link types?
For the Link Type(s) where you want to use this what are the Inward and Outward Descriptions for the link type? That information will be on the configuration page for the Issue Links. A Jira Administrator will have access to that information.
For example in my system the Blocks link type has this information.
Let us say that we link AAA-1 to BBB-1 with this link type thus:
AAA-1 blocks BBB-1
Conversely
BBB-1 is blocked by AAA-1
AAA-1 will be the "source" issue that triggers the rule. BBB-1 will be the destination issue.
So, for whatever link type you have, when the relationship of the linked issues is
AAA-1 <outward description> BBB-1
...then AAA-1 is the source/trigger issue.
If the Inward and Outward Descriptions are the same, as with the Relates link type, then the issue you are in when you create the link is always considered the "source"/trigger issue.
As long as you can keep that straight and know to which issue (source/trigger vs. destination issue) you want to apply the comment then you can automate the application of the comments.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I tried adding another condition If: status equals maintenance under the For Destination issue, as you suggested. However, nothing gets commented on the trigger (source) jira. The first Add comment gets posted on the destination jira. But the second Add comment doesn't post on either.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
After looking in the logs it is checking if the Source ticket is in Maint mode. The source or trigger ticket will never be in maintenance status. Only the destination ticket will be moved into maint mode. So I need to figure out how to check that the destination ticket is in maint mode, same as the first If: status equals did.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Only the destination jira will be put into maintenance mode. If any other ticket links to it with any link type, after the destination ticket was put into maintenance status
1. The maintenance ticket gets a comment "THE ISSUE {{triggerIssue}} HAS BEEN ADDED AFTER THE MAINTENANCE FREEEZE!" this works great
2. The source/trigger ticket (Which will NOT be in maintenance mode) should also get a different comment on that ticket.
My problem I'm having is trying to add the second part by checking if the destination ticket status is in Maintenance status then add the comment to the source/trigger ticket.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for that additional explanation.
If the comment should be added to the source issue only if the destination issues Status=Maintenance then change this condition:
Change that to an Advanced Compare.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's still not working. I used DEVTOOLS-22789 (Which is not in Maint mode) to link to ticket INF-262719 (which is in Maint Mode). The destination ticket was commented on, the email was sent, the source ticket still did not get a comment.
This is the audit log:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Add a Log action just before the Advanced Compare to print out {{destinationIssue.status.name}} to the rule's Audit Log.
What is the exact name of the "maintenance" Status value assigned to the DEVTOOLS issue? The comparison might be case sensitive. I notice your latest copy of the rule shows that comparison using Maintenance where you previous images show the Status field being compared to maintenance.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
aha! You got it. I don't type it in when selecting the maintenance value for the issue field condition, it's a pull down menu option. But I did type it in for the compare two values and capitalized the word Maintenance. So it would never match. Thank you so much for all of your help. It works perfectly now. You have been very helpful and I appreciate it!
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.