Prevent an issue from being transition to another status via API or Webhooks

Hi @kkercz,

I’m trying to validate my query by making request on endpoint: /rest/api/3/expression/eval
As far as I see in the API documentation: https://developer.atlassian.com/cloud/jira/platform/rest/v3/?utm_source=%2Fcloud%2Fjira%2Fplatform%2Frest%2F&utm_medium=302#api-api-3-expression-eval-post
it is not possible to provide transition object inside of the context property (I was trying to provide transion.id inside of context object).

Service responded with the below message:


{
  "errorMessages": [
    "Unrecognized field \"transition\" (Class com.atlassian.jira.rest.bean.JiraExpressionEvalContextBean), not marked as ignorable\n at [Source: com.atlassian.plugin.connect.plugin.auth.scope.InputConsumingHttpServletRequest$1@3a383826; line: 1, column: 157] (through reference chain: com.atlassian.jira.rest.bean.JiraExpressionEvalContextBean[\"transition\"])"
  ]
}

Could you please tell me when are you planning to add transition object to the expression validator context?

Regards,
Andrzej

Hi, @awieczorek,

You are right, it is not possible to provide the transition object, as stated in the docs for the workflow condition module:

Using the Jira expressions REST resource, you can test how expressions behave when interacting with statuses by getting one with issue.status . This allows you to do the testing without obtaining the transition context variable, which is not possible in the resource.

I haven’t been actually planning to add that context variable to the API, as I figured it wouldn’t be that useful. The object is quite simple and has just five fields, all of them of simple types, apart from the source and target status, which, as mentioned above, can be tested otherwise.

Hope this helps.

Best regards
Krzysztof

@kkercz thanks a lot :slight_smile: