Hi All,
I have 4 status in PROJECT 1-
Open -> In Progress -> In Review -> Resolved.
Step 1
I have a ticket in PROJECT 1; when the ticket is moved from Open -> In Progress; it automatically creates a ticket in PROJECT 2 and links to PROJECT 1 ticket with link type 'has dependency'.
Step 2
Now, when the above created ticket in PROJECT 2 is cancelled, the PROJECT 1 ticket(which was in IN PROGRESS status) moves to IN REVIEW, which in turn creates another ticket in PROJECT 2(but with different summary, I am setting the summary and description via scripting).
My question: is it possible to link (type - 'is caused by') the ticket created in Project 2(Step 2: IN REVIEW transition) to the ticket in PROJECT 2 which was cancelled(created when IN PROGRESS status) before in Project 2(based on summary), via post function or JIRA automation.
I tried via automation but no luck. If this is possible can via scripting can some one help!
Thank you.
Yep, if you have Scriptrunner, these are both possible.
The first is surprisingly easy if you have a recent version of SR (one with HAPI capabilities)
From memory:
// Create a new issue
def newIssue = Issues.create('projectKey', 'issueType') {
setSummary('New issue')
}
// Link the new issue to the existing issue
issue.link('linkType', newIssue)
The second is a bit more involved, but you should be able to find snippets and examples to help you with it in https://library.adaptavist.com
For the first one I had already implemented the logic and it works perfectly, since it's a straight default post function (clone funtion in wf).
Since for step 2: the requirement, is to link the issue which is getting created when it goes to in review status to the ticket which was triggered in step 1 and is cancelled.
Thanks again for the help. Any suggestions would be a great help. I think it's a bit tricky.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Harsh ,
you can use a scripted post function and use JIRA API https://docs.atlassian.com/software/jira/docs/api/8.1.0/index.html?com/atlassian/jira/issue/link/IssueLinkManager.html
Fabio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reply. I did try but it works when you are creating a issue in one transition.
It is not working in my scenario. If you have any test script that fits the scenario would be a great help.
Thanks again!
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.