Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
badges earned

Your Points Tracker
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Jira DataCenter - ScriptRunner - Auto-transition on subtasks not working


I had a ticket open for this in Adaptavist support as well. 

We upgraded our Jira Server and all add-ons including ScriptRunner to Data Center this past weekend. We upgraded ScriptRunner by several versions during this process.

After the migration, our users noticed that the auto-transition of subtasks was working on and off. I am including the script here. This script works at times and other times I dont think it does anything. We added some log warn statements to follow the script execution but nothing is seen in the logs. However, the screen status says it successfully executed for a Jira Issue and we can confirm that in the Payload.

Last night, I spent some more time troubleshooting and it turned out commenting out the following line in the script - "setSkipScreenCheck(true)", fixed the Issue. No comments are being added to the subtasks during the transition but that is less of an Issue now. I understand "setSkipScreenCheck(true)" is to add comment on a ticket when the field is not available on the Edit screen. Not sure why that would affect the transition, though.


Here is the original Parent Issue PostFunction script

import com.atlassian.jira.bc.issue.IssueService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueInputParameters
import com.atlassian.jira.issue.fields.CustomField

CustomField deplInEnv = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("Deployed in Environment")

IssueService issueService = ComponentAccessor.getIssueService()
def user = ComponentAccessor.getUserManager().getUserByName("automation")
for(Issue subTask:issue.getSubTaskObjects()) {
if ((subTask.getStatusId() == "10102") && ((!subTask.getCustomFieldValue(deplInEnv)) || (!subTask.getCustomFieldValue(deplInEnv)*.value.contains('Stage')))) {
IssueInputParameters issueInputParameters = issueService.newIssueInputParameters()
issueInputParameters.with {
setComment("Moving subtasks to ToDo from Parent Deployment Request")
// validate and transition subtask
def validationResult = issueService.validateTransition(user, subTask.getId(), 111, issueInputParameters)
if (validationResult.isValid()) {
def issueResult = issueService.transition(user, validationResult)
if (! issueResult.isValid()) {
log.warn("Failed to transition subtask ${subTask.key}, errors: ${issueResult.errorCollection}")
} else {
log.warn("Could not transition subtask ${subTask.key}, errors: ${validationResult.errorCollection}")


0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Marketplace Apps & Integrations

Staying organized with Jira: best practices for a better project management

Project managers know this problem: A “mountain of work” lays in front of you, and you don’t know how and where to tackle them. Different to-dos lie ahead, but just one task after the other can be ha...

224 views 2 1
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you