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

Call a transition by rest endpoint


I wrote a script in 'REST Endpoint' and 'script fragments' that calls a transition by clicking a button.

The screen of this transition didn't pop-up but the transition itself happened.

I need this screen to shown before the transition, Can you know what is missing?


This is my script:


import groovy.transform.BaseScript
import groovy.transform.BaseScript
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.ComponentManager
import javax.servlet.http.HttpServletRequest;
import com.atlassian.jira.bc.issue.IssueService
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.bc.ServiceResultImpl
import com.atlassian.jira.bc.issue.IssueService.TransitionValidationResult
import com.atlassian.jira.issue.IssueInputParametersImpl
import com.atlassian.jira.issue.IssueInputParameters
import com.atlassian.jira.workflow.TransitionOptions
import static com.atlassian.jira.workflow.TransitionOptions.Builder;

@BaseScript CustomEndpointDelegate delegate

Deferred(httpMethod: "GET") {
MultivaluedMap queryParams,String body, HttpServletRequest request ->

String theUrltoReturn = ""
String issueId;
String clonedMessage;
try {

issueId = queryParams.getFirst("issueId") as String
IssueManager issueManager = ComponentAccessor.getIssueManager();
Issue issue = issueManager.getIssueObject(Long.parseLong(issueId));

CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();

// def baseURL = ComponentAccessor.getApplicationProperties()getString(APKeys.JIRA_BASEURL)

//theUrltoReturn = request.getHeader("reffer");
//theUrltoReturn = baseURL+'/browse/'+issue
theUrltoReturn = request.getHeader("referer");
log.warn theUrltoReturn
catch (e) {
return Response.serverError().entity([error: e.message]).build();



void DeferredTransition(issueId) {
try {
Issue issue
if (isNumeric(issueId)){

issue =

issue =


IssueService issueService = ComponentAccessor.getIssueService()
int actionId = 241// Deferred
TransitionValidationResult transitionValidationResult
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()

IssueInputParameters issueInputParameters = issueService.newIssueInputParameters();
TransitionOptions trasitionOptions = new Builder().skipPermissions().skipValidators().setAutomaticTransition().skipConditions().build();

transitionValidationResult = issueService.validateTransition(currentUser,, actionId, issueService.newIssueInputParameters(),trasitionOptions)

if (transitionValidationResult.isValid()) {
issueService.transition(currentUser, transitionValidationResult)
else {
log.warn("The transitionValidation is not valid")

} catch (Exception e) {

boolean isNumeric(String inputData) {
return inputData.matches("[-+]?\\d+(\\.\\d+)?");

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

168 views 6 7
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