Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-32132

Internal Server Error if transition destination is undefined or the same state as the original status

      NOTE: This bug report is for JIRA Server. Using JIRA Cloud? See the corresponding bug report.

      Summary

      Using the REST command to execute transaction will return error 500 if the transition destination is a (-1) no result step (loop).

      cURL command used
      curl -D- -u admin:admin -X POST --data @"C:/Users/ChungPark/Desktop/data.json" -H "Content-Type: application/json" http://localhost:8527/rest/api/2/issue/PP-8/transitions?expand=transitions.fields
      
      json data
      {
          "transition": {
              "id": "711"
          }
      }
      

      Error thrown in REST client

      Exception in thread "main" com.atlassian.jira.rest.client.RestClientException: Internal server error
      	at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:68)
      	at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.getAndParse(AbstractJerseyRestClient.java:80)
      	at com.atlassian.jira.rest.client.internal.jersey.JerseyIssueRestClient.getIssue(JerseyIssueRestClient.java:142)
      	at com.atlassian.jira.rest.client.internal.jersey.JerseyIssueRestClient.getIssue(JerseyIssueRestClient.java:133)
      	at RestTry.main(RestTry.java:27)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
      Caused by: com.sun.jersey.api.client.UniformInterfaceException: Client response status: 500
      	at com.sun.jersey.api.client.WebResource.handle(WebResource.java:676)
      	at com.sun.jersey.api.client.WebResource.get(WebResource.java:191)
      	at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient$1.call(AbstractJerseyRestClient.java:84)
      	at com.atlassian.jira.rest.client.internal.jersey.AbstractJerseyRestClient.invoke(AbstractJerseyRestClient.java:54)
      	... 9 more
      

      Error thrown in atlassian-jira.log

      013-03-14 21:25:05,274 http-bio-8527-exec-1 ERROR admin 1285x3280x1 14nlcoe 127.0.0.1 /rest/api/latest/issue/WFP-3 [jira.rest.exception.ExceptionInterceptor] Returning internal server error in response
      java.lang.reflect.InvocationTargetException
      	at sun.reflect.GeneratedMethodAccessor1190.invoke(Unknown Source)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)
      	at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$ResponseOutInvoker$1.invoke(DispatchProviderHelper.java:234)
      	at com.atlassian.plugins.rest.common.interceptor.impl.DispatchProviderHelper$1.intercept(DispatchProviderHelper.java:100)  <+3> (DefaultMethodInvocation.java:61) (ExpandInterceptor.java:38) (DefaultMethodInvocation.java:61)
      	at com.atlassian.jira.rest.exception.ExceptionInterceptor.intercept(ExceptionInterceptor.java:59)  <+1> (DefaultMethodInvocation.java:61)
      	at com.atlassian.jira.rest.v2.issue.scope.RequestScopeInterceptor.intercept(RequestScopeInterceptor.java:43)  <+15> (DefaultMethodInvocation.java:61) (DispatchProviderHelper.java:132) (DispatchProviderHelper.java:230) (ResourceJavaMethodDispatcher.java:75) (HttpMethodRule.java:288) (RightHandPathRule.java:147) (ResourceClassRule.java:108) (RightHandPathRule.java:147) (RootResourceClassesRule.java:84) (WebApplicationImpl.java:1469) (WebApplicationImpl.java:1400) (WebApplicationImpl.java:1349) (WebApplicationImpl.java:1339) (WebComponent.java:416) (ServletContainer.java:537)
      	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegatingServletFilter.java:178)  <+1> (ServletContainer.java:795)
      	at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:73)  <+16> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) (RestServletUtilsUpdaterFilter.java:26) (RestServletUtilsUpdaterFilter.java:40) (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) (ContextFilter.java:25) (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66)
      	at com.atlassian.mywork.client.filter.ServingRequestsFilter.doFilter(ServingRequestsFilter.java:37)  <+15> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (AccessLogFilter.java:103) (AccessLogFilter.java:87) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (XsrfTokenAdditionRequestFilter.java:54) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (IteratingFilterChain.java:46) (DelegatingPluginFilter.java:66)
      	at com.atlassian.labs.remoteapps.modules.permissions.ApiScopingFilter.doFilter(ApiScopingFilter.java:60)  <+22> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (SecurityFilter.java:234) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (TrustedApplicationsFilter.java:98) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (BaseLoginFilter.java:169) (JiraLoginFilter.java:70) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (IteratingFilterChain.java:46) (DelegatingPluginFilter.java:66) (OAuthFilter.java:55) (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66)
      	at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:40)  <+9> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (AbstractJohnsonFilter.java:71) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210)
      	at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:176)
      	at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
      	at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)  <+9> (UrlRewriteFilter.java:394) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (GzipFilter.java:80) (GzipFilter.java:51) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (IteratingFilterChain.java:46) (DelegatingPluginFilter.java:66)
      	at com.atlassian.labs.remoteapps.modules.oauth.OAuth2LOFilter.doFilter(OAuth2LOFilter.java:70)  <+3> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66)
      	at com.atlassian.labs.remoteapps.util.http.bigpipe.RequestIdSettingFilter.doFilter(RequestIdSettingFilter.java:22)  <+43> (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (DelegatingPluginFilter.java:66) (JWDSendRedirectFilter.java:25) (DelegatingPluginFilter.java:74) (IteratingFilterChain.java:42) (ServletFilterModuleContainerFilter.java:77) (ServletFilterModuleContainerFilter.java:63) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (ChainedFilterStepRunner.java:78) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (AbstractCachingFilter.java:33) (AbstractHttpFilter.java:31) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (AbstractEncodingFilter.java:41) (AbstractHttpFilter.java:31) (PathMatchingEncodingFilter.java:45) (AbstractHttpFilter.java:31) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (JiraStartupChecklistFilter.java:74) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (MultiTenantServletFilter.java:91) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (ChainedFilterStepRunner.java:78) (ApplicationFilterChain.java:243) (ApplicationFilterChain.java:210) (StandardWrapperValve.java:225) (StandardContextValve.java:123) (AuthenticatorBase.java:472) (StandardHostValve.java:168) (ErrorReportValve.java:98) (StandardEngineValve.java:118) (AccessLogValve.java:927) (CoyoteAdapter.java:407) (AbstractHttp11Processor.java:1001) (AbstractProtocol.java:585) (JIoEndpoint.java:310)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:662)
      Caused by: java.lang.NullPointerException
      	at com.atlassian.jira.rest.v2.issue.TransitionMetaBeanBuilder.getStatusFromStep(TransitionMetaBeanBuilder.java:83)
      	at com.atlassian.jira.rest.v2.issue.TransitionMetaBeanBuilder.build(TransitionMetaBeanBuilder.java:69)
      	at com.atlassian.jira.rest.v2.issue.IssueBeanBuilder.addTransitions(IssueBeanBuilder.java:138)
      	at com.atlassian.jira.rest.v2.issue.IssueBeanBuilder.build(IssueBeanBuilder.java:111)
      	at com.atlassian.jira.rest.v2.issue.IssueResource.getIssue(IssueResource.java:434)
      

      Environment

      The error only occurs when a REST client is used, such as JIRA REST client. Testing using cURL does not return any error.

      When Stash is integrated to JIRA, the following message will be displayed when trying to browse JIRA issues linked to the problematic global transition:

      Can't display issues
      Either you don't have access to view them or they don't exist. Please contact your system administrator if you believe this is incorrect.
      instead of the integration I was hoping for.
      

      Workaround

      • Set a destination step for the affected transition.
      • Do not set global transition as it only affects global transition.

      UPDATE

      Using a cURL command performing GET will return {"errorMessages":["Internal server error"],"errors":}.

          Form Name

            [JRASERVER-32132] Internal Server Error if transition destination is undefined or the same state as the original status

            Hi IntegrationAndRelease,

            Could you please create a support ticket at https://support.atlassian.com? Given this is a resolved bug, and we have had no reports of regressions, it is likely that you are seeing a different use altogether. Consequently, we will need to work with you to understand the details of the problem you are seeing in your instance to move that issue forwards.

            The credentials should be the same as for this site (https://jira.atlassian.com).

            Regards,

            Oswaldo Hernández.
            JIRA Bugmaster.
            [Atlassian].

            Oswaldo Hernandez (Inactive) added a comment - Hi IntegrationAndRelease , Could you please create a support ticket at https://support.atlassian.com? Given this is a resolved bug, and we have had no reports of regressions, it is likely that you are seeing a different use altogether. Consequently, we will need to work with you to understand the details of the problem you are seeing in your instance to move that issue forwards. The credentials should be the same as for this site ( https://jira.atlassian.com ). Regards, Oswaldo Hernández. JIRA Bugmaster. [Atlassian] .

            integrationandrelease added a comment -

            This seems to be happening again in Stash - JIRA integration for some of the issues. Stash version 3.10.0 and JIRA version 6.4.7

            curl -u "user:pass" https://someurl.jira.coom/rest/api/latest/issue/TEST-45/transitions

            results in

            {"errorMessages":["Internal server error"],"errors":{}}

            integrationandrelease added a comment - This seems to be happening again in Stash - JIRA integration for some of the issues. Stash version 3.10.0 and JIRA version 6.4.7 curl -u "user:pass" https://someurl.jira.coom/rest/api/latest/issue/TEST-45/transitions results in {"errorMessages": ["Internal server error"] ,"errors":{}}

            Hi Gabriel
            Have a look on JRA-33692

            Vincent Thoulé added a comment - Hi Gabriel Have a look on JRA-33692

            Either I'm missing something or the issue was solved by disabling the function. We're being impacted by this bug so I'm testing JIRA 6.2.5 to upgrade from our current 6.0.4, and found out that there is no option to create a global transition to -1... was that the solution?

            Gabriel Brussa added a comment - Either I'm missing something or the issue was solved by disabling the function. We're being impacted by this bug so I'm testing JIRA 6.2.5 to upgrade from our current 6.0.4, and found out that there is no option to create a global transition to -1... was that the solution?

            Thanks for jumping in kschoenh

            zedelta, indeed the fix is only available in JIRA 6.2.2 and later, so you will need to upgrade your JIRA instance to that to be able to obtain this fix.

            Hope the information helps.

            Regards,

            Oswaldo Hernández.
            JIRA Bugmaster.
            [Atlassian].

            Oswaldo Hernandez (Inactive) added a comment - Thanks for jumping in kschoenh zedelta , indeed the fix is only available in JIRA 6.2.2 and later, so you will need to upgrade your JIRA instance to that to be able to obtain this fix. Hope the information helps. Regards, Oswaldo Hernández. JIRA Bugmaster. [Atlassian] .

            This was fixed in 6.2.2 I believe, and will not be back-fixed to prior versions.

            Kelly Schoenhofen added a comment - This was fixed in 6.2.2 I believe, and will not be back-fixed to prior versions.

            uuuu added a comment -

            Our company is still using JIRA 6.0.1, does this mean that this error still exists with 6.0.1? I tried changing status/transitions using cURL and it failed but I can change it through the web interface.

            uuuu added a comment - Our company is still using JIRA 6.0.1, does this mean that this error still exists with 6.0.1? I tried changing status/transitions using cURL and it failed but I can change it through the web interface.

            I have verified that this problem is resolved on 6.3-OD-2 as well.

            Happy Days!

            Jon Whitcraft added a comment - I have verified that this problem is resolved on 6.3-OD-2 as well. Happy Days!

            Chad Juliano added a comment - - edited

            I have verified that problem is resolved in 6.2.2.

            Chad Juliano added a comment - - edited I have verified that problem is resolved in 6.2.2.

            Hi chad.juliano,

            6.2.2 is available for download already

            Regards,

            Oswaldo Hernández.
            JIRA Bugmaster.
            [Atlassian].

            Oswaldo Hernandez (Inactive) added a comment - Hi chad.juliano , 6.2.2 is available for download already Regards, Oswaldo Hernández. JIRA Bugmaster. [Atlassian] .

            Awesome! Thanks for fixing this. I am in anticipation of the 6.2.2 release.

            Chad Juliano added a comment - Awesome! Thanks for fixing this. I am in anticipation of the 6.2.2 release.

            Ian Dick added a comment -

            Pairing with ohernandez@atlassian.com to QA this fix.

            Ian Dick added a comment - Pairing with ohernandez@atlassian.com to QA this fix.

            Petr Musil added a comment -

            + 6.1.6, 6.1.7, 6.2 version

            Petr Musil added a comment - + 6.1.6, 6.1.7, 6.2 version

            senthil.kc: To recompile you first need to have the Atlassian Plugin SDK installed:

            then in your modified source directory for the rest plugin you can run:

            atlas-mvn clean
            atlas-mvn compile
            atlas-mvn package
            

            The .jar file should then be found in the "target" directory.

            Hope this helps.

            Thomas Pike added a comment - senthil.kc : To recompile you first need to have the Atlassian Plugin SDK installed: Install the Atlassian SDK on a Windows System Install the Atlassian SDK on a Linux or Mac System then in your modified source directory for the rest plugin you can run: atlas-mvn clean atlas-mvn compile atlas-mvn package The .jar file should then be found in the "target" directory. Hope this helps.

            senthil added a comment -

            Thomas Pike - I do face the same issue. Unfortunately, its not clear on how to recompile and package jira-rest-plugin.jar (required dependencies, classes)

            Is there any link where I can download the fixed jira-rest-plugin.jar or can you share some inputs on how to get this done in my environment?

            senthil added a comment - Thomas Pike - I do face the same issue. Unfortunately, its not clear on how to recompile and package jira-rest-plugin.jar (required dependencies, classes) Is there any link where I can download the fixed jira-rest-plugin.jar or can you share some inputs on how to get this done in my environment?

            I made another attempt today to eliminate our use of the SOAP API that Atlassian has deprecated for several versions, but I ran into this issue again. It seems strange that you need to use a deprecated API to get information about issues even on the 6.1 series.

            Patrick Earl added a comment - I made another attempt today to eliminate our use of the SOAP API that Atlassian has deprecated for several versions, but I ran into this issue again. It seems strange that you need to use a deprecated API to get information about issues even on the 6.1 series.

            Note that this also affects getting an issue history, if one of the transitions in the history is a global transition (see JRA-36784)

            I don't quite understand how this can be considered "minor"... Plus, it's just sooo easy to fix, and the fix has already been contributed above.

            David [old account] added a comment - Note that this also affects getting an issue history, if one of the transitions in the history is a global transition (see JRA-36784 ) I don't quite understand how this can be considered "minor"... Plus, it's just sooo easy to fix, and the fix has already been contributed above.

            I told ALMWorks that we can't use their product until this issue is resolved. This issue is almost a year old and it is causing problems for numerous third party vendors. Please consider escalating.

            Chad Juliano added a comment - I told ALMWorks that we can't use their product until this issue is resolved. This issue is almost a year old and it is causing problems for numerous third party vendors. Please consider escalating.

            This bug is preventing us to migrate from SOAP to REST for maintenance tasks here at OpenBet.

            Elias Karakoulakis added a comment - This bug is preventing us to migrate from SOAP to REST for maintenance tasks here at OpenBet.

            Chad Juliano added a comment - - edited

            This bug is causing issues with the JIRA client from ALMWorks. We can't use it to change workflow states until this is resolved because our workflow has global transitions.

            Chad Juliano added a comment - - edited This bug is causing issues with the JIRA client from ALMWorks. We can't use it to change workflow states until this is resolved because our workflow has global transitions.

            Mark Symons added a comment - - edited

            I would also like to see a fix. I now have now seen this exception 1000 times and, along with all the other ERROR spam that JIRA generates (such as JRA-34147), I am finding JIRA so much harder to administer than it should be. The spam has caused me to miss many a log ERROR that I should have seen..

            Mark Symons added a comment - - edited I would also like to see a fix. I now have now seen this exception 1000 times and, along with all the other ERROR spam that JIRA generates (such as JRA-34147 ), I am finding JIRA so much harder to administer than it should be. The spam has caused me to miss many a log ERROR that I should have seen..

            MarkW added a comment -

            Adding comment here to support a push to get this fixed. We have found this bug today. It is more of an annoyance than a show stopper for us but would still like to get this fixed.

            Thanks

            MarkW added a comment - Adding comment here to support a push to get this fixed. We have found this bug today. It is more of an annoyance than a show stopper for us but would still like to get this fixed. Thanks

            This is a real blocker for one of our projects.

            Tobias Anstett (K15t) added a comment - This is a real blocker for one of our projects.

            Yep. I gave up waiting and re-structured the workflow that our bugs/etc use and moved it into production ~2 weeks ago. It ended up being not a huge deal - we rarely even used the transitionless portion of our workflow.

            Kelly Schoenhofen added a comment - Yep. I gave up waiting and re-structured the workflow that our bugs/etc use and moved it into production ~2 weeks ago. It ended up being not a huge deal - we rarely even used the transitionless portion of our workflow.

            JIRA v6.1 is still affected…

            Caused by: java.lang.NullPointerException
            	at com.atlassian.jira.rest.v2.issue.TransitionMetaBeanBuilder.getStatusFromStep(TransitionMetaBeanBuilder.java:83)
            	at com.atlassian.jira.rest.v2.issue.TransitionMetaBeanBuilder.build(TransitionMetaBeanBuilder.java:69)
            	at com.atlassian.jira.rest.v2.issue.IssueBeanBuilder.addTransitions(IssueBeanBuilder.java:138)
            	at com.atlassian.jira.rest.v2.issue.IssueBeanBuilder.build(IssueBeanBuilder.java:111)
            	at com.atlassian.jira.rest.v2.issue.IssueResource.getIssue(IssueResource.java:438)
            

            Jacek Konieczny added a comment - JIRA v6.1 is still affected… Caused by: java.lang.NullPointerException at com.atlassian.jira.rest.v2.issue.TransitionMetaBeanBuilder.getStatusFromStep(TransitionMetaBeanBuilder.java:83) at com.atlassian.jira.rest.v2.issue.TransitionMetaBeanBuilder.build(TransitionMetaBeanBuilder.java:69) at com.atlassian.jira.rest.v2.issue.IssueBeanBuilder.addTransitions(IssueBeanBuilder.java:138) at com.atlassian.jira.rest.v2.issue.IssueBeanBuilder.build(IssueBeanBuilder.java:111) at com.atlassian.jira.rest.v2.issue.IssueResource.getIssue(IssueResource.java:438)

            Please fix "jira-rest-plugin" - need only add 1 line to fix issue:

            com.atlassian.jira.rest.v2.issue.TransitionMetaBeanBuilder
                private Status getStatusFromStep(Issue issue, int stepId)
                {
                	if (stepId == -1) return issue.getStatusObject();
            

            Without this fix any using of jira-rest-java-client unpossible, because client request's all available transitions on getIssue - you can't get issue...

            Andrey Mikuloff added a comment - Please fix "jira-rest-plugin" - need only add 1 line to fix issue: com.atlassian.jira.rest.v2.issue.TransitionMetaBeanBuilder private Status getStatusFromStep(Issue issue, int stepId) { if (stepId == -1) return issue.getStatusObject(); Without this fix any using of jira-rest-java-client unpossible, because client request's all available transitions on getIssue - you can't get issue...

            dmhigdon added a comment -

            Any update?

            dmhigdon added a comment - Any update?

            If the 6.1 beta fixes this issue (manifesting for us that Stash can't integrate with Jira as a result of our workflow having a transition destination the same as the original status) that would be great. I'm concerned that this issue still says "Awaiting Development" though. Can anyone @ Atlassian confirm this is being tested in 6.1.0?

            Kelly Schoenhofen added a comment - If the 6.1 beta fixes this issue (manifesting for us that Stash can't integrate with Jira as a result of our workflow having a transition destination the same as the original status) that would be great. I'm concerned that this issue still says "Awaiting Development" though. Can anyone @ Atlassian confirm this is being tested in 6.1.0?

            Seems like the latest version of the Eclipse Mylyn Atlassian Connector (3.2.2.v20130909) together with the currently deployed Jira version on atlassian.net (6.1-OD-06-1 build 6139) has fixed the problem. I'm not getting any errors anymore, and synchronization works smoothly. Thanks!

            Stefan Thurnherr added a comment - Seems like the latest version of the Eclipse Mylyn Atlassian Connector (3.2.2.v20130909) together with the currently deployed Jira version on atlassian.net (6.1-OD-06-1 build 6139) has fixed the problem. I'm not getting any errors anymore, and synchronization works smoothly. Thanks!

            This issue is preventing us from integrating Jira and Stash; one of our transitions is an escalate button and this bug apparently prevents the RESTful calls between Stash and Jira from working.

            Kelly Schoenhofen added a comment - This issue is preventing us from integrating Jira and Stash; one of our transitions is an escalate button and this bug apparently prevents the RESTful calls between Stash and Jira from working.

            This issue prevents me from using the Eclipse Mylyn Atlassian Connector with atlassian.net hosted jira.

            Stefan Thurnherr added a comment - This issue prevents me from using the Eclipse Mylyn Atlassian Connector with atlassian.net hosted jira.

            I've tested the above patch suggested by Manuel Arranz, and it appears to fix this bug perfectly. Reposting the exact fix as the formatting is broken in the above comment:

            Replace

                private Status getStatusFromStep(Issue issue, int stepId)
                {
                    final WorkflowDescriptor wd = workflowManager.getWorkflow(issue).getDescriptor();
                    String statusId = (String) wd.getStep(stepId).getMetaAttributes().get(JiraWorkflow.STEP_STATUS_KEY);
                    return statusManager.getStatus(statusId);
                }
            

            with:

                private Status getStatusFromStep(Issue issue, int stepId)
                {
                    final WorkflowDescriptor wd = workflowManager.getWorkflow(issue).getDescriptor();
                    String statusId = null;
                    if ( null != wd.getStep(stepId) ){
                        statusId = (String) wd.getStep(stepId).getMetaAttributes().get(JiraWorkflow.STEP_STATUS_KEY);
                    } else {
                        statusId = (String) issue.getStatusObject().getId();
                    }
                    return statusManager.getStatus(statusId);
                }
            

            in TransitionMetaBeanBuilder (jira-project/jira-components/jira-plugins/jira-rest/jira-rest-plugin/src/main/java/com/atlassian/jira/rest/v2/issue/TransitionMetaBeanBuilder.java).

            Recompiled and packaged jira-rest-plugin.jar and updated it in atlassian-bundled-plugins.zip

            Thomas Pike added a comment - I've tested the above patch suggested by Manuel Arranz, and it appears to fix this bug perfectly. Reposting the exact fix as the formatting is broken in the above comment: Replace private Status getStatusFromStep(Issue issue, int stepId) { final WorkflowDescriptor wd = workflowManager.getWorkflow(issue).getDescriptor(); String statusId = ( String ) wd.getStep(stepId).getMetaAttributes().get(JiraWorkflow.STEP_STATUS_KEY); return statusManager.getStatus(statusId); } with: private Status getStatusFromStep(Issue issue, int stepId) { final WorkflowDescriptor wd = workflowManager.getWorkflow(issue).getDescriptor(); String statusId = null ; if ( null != wd.getStep(stepId) ){ statusId = ( String ) wd.getStep(stepId).getMetaAttributes().get(JiraWorkflow.STEP_STATUS_KEY); } else { statusId = ( String ) issue.getStatusObject().getId(); } return statusManager.getStatus(statusId); } in TransitionMetaBeanBuilder (jira-project/jira-components/jira-plugins/jira-rest/jira-rest-plugin/src/main/java/com/atlassian/jira/rest/v2/issue/TransitionMetaBeanBuilder.java). Recompiled and packaged jira-rest-plugin.jar and updated it in atlassian-bundled-plugins.zip

            I don't know why this issue is still pending while it's clear it's a bug. The two proposed workaround are completely useless since they are contrary to the global transactions use. We have fixed the problem with this piece of code inside TransitionMetaBeanBuilder:

            /**

            • @param issue issue object to derive the worflow from
            • @param stepId the step id to get the status id for
            • @return the the status which stepId maps to in the associated workflow
              */
              private Status getStatusFromStep(Issue issue, int stepId)
              Unknown macro: { final WorkflowDescriptor wd = workflowManager.getWorkflow(issue).getDescriptor(); //String statusId = (String) wd.getStep(stepId).getMetaAttributes().get(JiraWorkflow.STEP_STATUS_KEY); String statusId = null; if ( null != wd.getStep(stepId) ){ statusId = (String) wd.getStep(stepId).getMetaAttributes().get(JiraWorkflow.STEP_STATUS_KEY); }else{ //Si tenemos un null, recuperamos el id del estado de la propia issue statusId = (String) issue.getStatusObject().getId(); } return statusManager.getStatus(statusId); }

            Manuel Arranz added a comment - I don't know why this issue is still pending while it's clear it's a bug. The two proposed workaround are completely useless since they are contrary to the global transactions use. We have fixed the problem with this piece of code inside TransitionMetaBeanBuilder: /** @param issue issue object to derive the worflow from @param stepId the step id to get the status id for @return the the status which stepId maps to in the associated workflow */ private Status getStatusFromStep(Issue issue, int stepId) Unknown macro: { final WorkflowDescriptor wd = workflowManager.getWorkflow(issue).getDescriptor(); //String statusId = (String) wd.getStep(stepId).getMetaAttributes().get(JiraWorkflow.STEP_STATUS_KEY); String statusId = null; if ( null != wd.getStep(stepId) ){ statusId = (String) wd.getStep(stepId).getMetaAttributes().get(JiraWorkflow.STEP_STATUS_KEY); }else{ //Si tenemos un null, recuperamos el id del estado de la propia issue statusId = (String) issue.getStatusObject().getId(); } return statusManager.getStatus(statusId); }

            could be solved identically as JRA-25553

            Jozef Kotlár added a comment - could be solved identically as JRA-25553

            The root cause of the issue is when the rest call try to pick up the status from the workflow: TransitionMetaBeanBuilder.java

                
            private Status getStatusFromStep(Issue issue, int stepId)
                {
                    final WorkflowDescriptor wd = workflowManager.getWorkflow(issue).getDescriptor();
                    String statusId = (String) wd.getStep(stepId).getMetaAttributes().get(JiraWorkflow.STEP_STATUS_KEY);
                    return statusManager.getStatus(statusId);
                }
            
            }
            

            The method workflowManager.getWorkflow.getDescriptor.getStep:

                public StepDescriptor getStep(int id) {
                    for (Iterator iterator = steps.iterator(); iterator.hasNext();) {
                        StepDescriptor step = (StepDescriptor) iterator.next();
            
                        if (step.getId() == id) {
                            return step;
                        }
                    }
            
                    return null;
                }
            

            Will return NULL when the step ID is not found, I suppose it should return id value instead to pick up the unconditional value from the workflow.

            Yilin (Inactive) added a comment - The root cause of the issue is when the rest call try to pick up the status from the workflow: TransitionMetaBeanBuilder.java private Status getStatusFromStep(Issue issue, int stepId) { final WorkflowDescriptor wd = workflowManager.getWorkflow(issue).getDescriptor(); String statusId = ( String ) wd.getStep(stepId).getMetaAttributes().get(JiraWorkflow.STEP_STATUS_KEY); return statusManager.getStatus(statusId); } } The method workflowManager.getWorkflow.getDescriptor.getStep: public StepDescriptor getStep( int id) { for (Iterator iterator = steps.iterator(); iterator.hasNext();) { StepDescriptor step = (StepDescriptor) iterator.next(); if (step.getId() == id) { return step; } } return null ; } Will return NULL when the step ID is not found, I suppose it should return id value instead to pick up the unconditional value from the workflow.

            Let me add even an easier case: adding this global transition will completely break any REST operations regarding transitions, you will not be able to even get them.

            curl -u user:pass https://jira.example.coom/rest/api/latest/issue/JC-123/transitions

            will return

            {"errorMessages":["Internal server error"],"errors":{}}

            Sorin Sbarnea added a comment - Let me add even an easier case: adding this global transition will completely break any REST operations regarding transitions, you will not be able to even get them. curl -u user:pass https://jira.example.coom/rest/api/latest/issue/JC-123/transitions will return {"errorMessages": ["Internal server error"] ,"errors":{}}

              ohernandez@atlassian.com Oswaldo Hernandez (Inactive)
              cchan Chung Park Chan
              Affected customers:
              45 This affects my team
              Watchers:
              54 Start watching this issue

                Created:
                Updated: