Hi,
Our issues can contain multiple links with the same linktype (eg "is cloned by") but linked to different projects (eg. JIRA1, JIRA2,...).
I only want to place comments (postscript) on linked issues in project JIRA1, how would the Groovy script have to look like?
issue.getLinkedIssues("is cloned by") returns me a list of all the linked issues with this linktype, but I want to narrow it down to only the linked issues from project JIRA1.
Many thanks in advance!
Rik
Hi
Before doing it with groovy script have you try to use automation for JIRA ? By doing a branch on linked issues then add a condition on the project = JIRA1 then comment ?
Regarding groovy script I' m a bit surprise that issue.getLinkedIssues("is cloned by") return something but if it does and if it' s a list of Issue Object you can narrow to get only those from a project by doing:
issue.getLinkedIssues("is cloned by").findAll{ it.getProjectObject().getKey() == "JIRA1"}
This will return only the issues from the project JIRA1 from your initial list. Use find instead of findAll if you only want the first Issue.
Regards
Don't have access to the branch option of automation, so that's no option.
Your solution does it's work splendid by the way :)
Thanks!
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.