Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hi,
We wish to create a linking structure between issues of Jira projects in such a manner that if ticket is closed in IMT project, the linked GCOOPS project tickets are automatically closed. Requesting guidance on how to make the above possible.
Without the use of Automation Rules, using scripting is it possible..
PLZ do the needful..
Thanks,
N.RAVIKANTH
Yes its possible using scripting if you have script runner plugin then you can write the script on close transaction postfunciton.
Which will check the linked issue and move it to the close.
If you have JSU or JMWE plugin the this is the default postfunciton you will get.
Accept the answer if it helps
Hi Sachin,
Thanks for the quick reply could u plz provide the post function..
Thanks,
N.Ravikanth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To get parent issue
issue.getParentObject().getIssueTypeObject().getName()
To Transit issue
import com.atlassian.jira.bc.issue.IssueService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueInputParametersImpl
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def issueManager = ComponentAccessor.issueManager
def issue = issueManager.getIssueObject(event.issue.key)
IssueService issueService = ComponentAccessor.getIssueService()
def actionId = 21 // change this to the step that you want the issues to be transitioned to
def transitionValidationResult
def transitionResult
def customFieldManager = ComponentAccessor.getCustomFieldManager()
log.debug("The issue type is: " + issue.getIssueType().name)
if (issue.getIssueType().name == "Task") {
transitionValidationResult = issueService.validateTransition(currentUser, issue.id, actionId,new IssueInputParametersImpl())
if (transitionValidationResult.isValid()) {
transitionResult = issueService.transition(currentUser, transitionValidationResult)
if (transitionResult.isValid())
{ log.debug("Transitioned issue $issue through action $actionId") }
else
{ log.debug("Transition result is not valid") }
}
else {
log.debug("The transitionValidation is not valid")
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How to set the source and destination projects in the JSU or JMWE post functions as per your suggestion mentioned in the yesterdays reply...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You dont need to define source and destination project. you just need to define the link type between two issue ( parent -child issue)
Based on that it will define which parent issue need to close
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ravi Kanth
if you have JMWE, you can simply use a "Transition Related Issues" post-function, no scripting required.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David,
Thanks a lot for the quick reply..
Could u plz explain the steps that how to implement..
Requirement is:
We wish to create a linking structure between issues of above mentioned Jira projects in such a manner that if an "Project1" ticket is closed, the linked "Project2" tickets are automatically closed. Requesting guidance on how to make the above possible.
In the Attached attachment could u please explain how the fields to be filled for "Transition Related Issues" post-function,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Ravi Kanth ,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Minor Change in requirement as suggested by the client that
We wish to create a linking structure between issues of mentioned Jira projects in such a manner that if a "IMT" project ticket status changed to "Done" from any other status, the "GCOOPS" project which is linked to "IMT" Project based on issue link type "has to be finished together" ticket should also automatically change the status to "Done" which is in currently "Raised Outside Project" Status.
Requesting guidance on how to make the above possible.
In the below Attached attachment could u please explain how the fields to be filled for "Transition Related Issues" post-function,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @[deleted]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @David Fischer ,
Thank u so much for the quick reply
As per the attached screen adding the transition name or ID of the transition that takes GCOOPS issues from the "Raised Outside Project" status to the "Done" status is not possible as you can see in the screen that transition do not exists from the "Raised Outside Project" status to the "Done" status.
Is there any way to bypass the transition from the "Raised Outside Project" status to the "Done" status and status can be changed from "Raised Outside Project" to the "Done" to the linked issues
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@[deleted]
The easiest is to add the missing transition and hide it from users by adding a "Hide from users (JMWE app)" condition on that transition. This way you'll be able to transition directly from Raised outside project to Done using the Transition Related Issues post-function, but users won't be able to.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @David Fischer ,
Thanks for the quick reply..
Is this Suggestable and u mentioned in the above reply "users won't able to" what does it mean could u give me the clarification about it..
Thanks,
N.Ravikanth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Users won't even see that new transition.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @David Fischer ,
The steps u provided its worked thanks from bottom of my heart..
Thanks,
N.Ravikanth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @David Fischer
I am not seeing the option of Target Issues in this post-function. Could you please clarify on this. BTW I am using cloud version of JMWE plugin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @sekhar reddy ,
it's the first option at the top (in the "Issues to operate on" section).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, I here with the same problem, but my scenario is:
when ALL linked issues in project A are closed,
ONLY then the issue in project B (to which the issues in project A are related to) to be transitioned to CLOSED.
Can this be achieved?
Many thanks,
Maria
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
are you on Server/DC or Cloud?
In any case, there are two approaches:
- set up a simple Transition Related Issues post-function that triggers the Close transition on the "parent" issue (in project B), and add a Related Issue Status Condition on the Close transition for project B to only allow the Close transition when all "children" issues (in project A) are Closed
- set up a Transition Related Issues post-function that triggers the Close transition on the "parent" issue (in project B), and add a "Conditional Execution" script to only execute the post-function when all children issues of the issue in project B are Closed. The exact script depends on the JMWE version (Server or Cloud)
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.