I have two projects TM and CO. When in TM, an issue is created, same issue is cloned to CO and a Cloners link is created between both issues.
What I want to do is that when the issue in CO is transitioned to Done, it should send a web request having the key of parent issue in TM project in its parameters or body. I am unable to get the link between both issues. Here is what I have tried
But, this condition never triggered. It always ends up with this response
I am unable to get what I should do regarding this as I am totally new to automation in Jira.
Thanks
I had to transition the linked issue to Done state and send a web request containing the parent issue key. Here is how I did it. I created a shared rule between both projects and then used the following automation flow to close the issue and send web request.
@Jamshaid Is your TM project available in scope from the rule of CO project?
I just tested a similar set up and if the cloned issue is within the same project, branch logic like you have picks it up as expected but if you dont have "scope" then you wont get the key from TM project.
So if thats the case with you and that is why you are not able to get the key, I was thinking of below approach which is without the branch logic.
But please confirm above step as thats the easiest route or work with your admin if you can be granted that scope.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kalyan Sattaluri Thanks. I am not really concerned about using branch logic. I just want to get the key of the parent issue. It is supposed to be only one having the current logic.
I will try your solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jamshaid Sure, Just edited my post with screenshot, please check and let me know
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kalyan Sattaluri I can't find Add value to Audit Log in then: Add an action
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In cloud, its called "Log action", please verify.
BTW, if you know you will only have 1 ofsuch cloned issue, you can skip variable part.
Either way, please log value first to check you are getting the value.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here is what appears in logs. It does not print anything from issue
Here is my rule
Here is the issue CO18
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your log below has TM-63 and your screenshot has TM-67.
Please post similar log like you posted below so we can cross check that it should be "inwards" or outwards direction in our log action
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kalyan Sattaluri I have got the list of linked issues. Thanks for your help
{{issue.links}} worked for me. It is enough for now.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kalyan Sattaluri The json shows that it is an inward
"issuelinks": [
{
"id": "10656",
"self": "https://mysite.atlassian.net/rest/api/2/issueLink/10656",
"type": {
"id": "10001",
"name": "Cloners",
"inward": "is cloned by",
"outward": "clones",
"self": "https://mysite.atlassian.net/rest/api/2/issueLinkType/10001"
},
"inwardIssue": {
"id": "11214",
"key": "TM-63",
"self": "https://mysite.atlassian.net/rest/api/2/issue/11214",
"fields": {
"summary": "test211",
"status": {
"self": "https://mysite.atlassian.net/rest/api/2/status/10001",
"description": "",
"iconUrl": "https://mysite.atlassian.net/images/icons/status_generic.gif",
"name": "Done",
"id": "10001",
"statusCategory": {
"self": "https://mysite.atlassian.net/rest/api/2/statuscategory/3",
"id": 3,
"key": "done",
"colorName": "green",
"name": "Done"
}.
I don't know why the condition you shared is not working
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Great, but the JSON you are showing again is for TM-63 and your screenshot has TM-67. I am curious whats the difference in link types between the two because syntax worked for me. Thats why I asked for JSON which showed TM-67 to look at the difference.
Either way, looks like you got what you wanted. Problem solved!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kalyan Sattaluri that json was for another issue. I just copied it from my other comments in this post.
I have linked another issue and it shows a comma (,) only in logs while trying your condition. Maybe something got changed by the webpage when you pasted the condition?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Kalyan Sattaluri The condition works with outwardIssue.key
{{#issue.issuelinks}}{{#if(equals(type.name,"Cloners"))}}{{outwardIssue.key}}{{^last}}, {{/}}{{/}}{{/}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Jamshaid if you have figured out a way, please consider to put it in a new post and mark your answer as accepted so others can benefit and that way this issue is closed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jamshaid ,
Maybe you should use 'cloned by' instead of 'clones' in the branch.
It depends how the two issues are linked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Rudy Holtkamp Even if i use is cloned by, it throws the same message in logs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The log says that it can't find a linked issue of the link type 'clones'.
So you might want to take a closer look to the issue by using:
https://yoursite.atlassian.net/rest/api/latest/issue/CO-17?expand=names
Then search for 'issuelinks', you should see something like this:
"issuelinks": [
{
"id": "10762",
"self": "https://rudy.atlassian.net/rest/api/2/issueLink/10762",
"type": {
"id": "10001",
"name": "Cloners",
"inward": "is cloned by",
"outward": "clones",
"self": "https://rudy.atlassian.net/rest/api/2/issueLinkType/10001"
},
"outwardIssue": {
"id": "11999",
"key": "RUDY-15",
"self": "https://rudy.atlassian.net/rest/api/2/issue/11999",
"fields": {}
}
}
]
Note: I use Chrome with an extension called JSON formatter.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Rudy Holtkamp this is the relevant output
"issuelinks": [
{
"id": "10656",
"self": "https://mysite.atlassian.net/rest/api/2/issueLink/10656",
"type": {
"id": "10001",
"name": "Cloners",
"inward": "is cloned by",
"outward": "clones",
"self": "https://mysite.atlassian.net/rest/api/2/issueLinkType/10001"
},
"inwardIssue": {
"id": "11214",
"key": "TM-63",
"self": "https://mysite.atlassian.net/rest/api/2/issue/11214",
"fields": {
"summary": "test211",
"status": {
"self": "https://mysite.atlassian.net/rest/api/2/status/10001",
"description": "",
"iconUrl": "https://mysite.atlassian.net/images/icons/status_generic.gif",
"name": "Done",
"id": "10001",
"statusCategory": {
"self": "https://mysite.atlassian.net/rest/api/2/statuscategory/3",
"id": 3,
"key": "done",
"colorName": "green",
"name": "Done"
}
},
"priority": {
"self": "https://mysite.atlassian.net/rest/api/2/priority/3",
"iconUrl": "https://luminsec.atlassian.net/images/icons/priorities/medium.svg",
"name": "Medium",
"id": "3"
},
"issuetype": {
"self": "https://mysite.atlassian.net/rest/api/2/issuetype/10101",
"id": "10101",
"description": "A problem which impairs or prevents the functions of the product.",
"iconUrl": "https://mysite.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10303?size=medium",
"name": "Bug",
"subtask": false,
"avatarId": 10303,
"hierarchyLevel": 0
}
}
}
}
],
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.