I am trying to pull a random item out of an array from a json webhook request. I've got the following done:
{{#=}}RANDOM(){{/}}{{webhookResponse.body.size}}{{#=}}FLOOR({{listSize}} * {{rand}}){{/}}{{newIndex.asNumber}}{{webhookResponse.body.get(newIndex)}Unfortunately, this doesn't work at all. I've tried variations like:
{{webhookResponse.body.get({{newIndex}})}}
When I just use a raw literal number, it works fine. e.g.,
{{webhookResponse.body.get(0)}} Not really helpful if I'm building a random function, basically.
Am I missing some nuance about the syntax here? Thanks
I am afraid that the REST API endpoint that performs transitions, POST /rest/api/2/issue/{issueIdOrKey}/transitions is not actually expected to provide any other REST response other than the HTTP 204 code for a successful transition. From that page:
Responses
- STATUS 400
If there is no transition specified.
- STATUS 204
Returned if the transition was successful.
- STATUS 404
The issue does not exist or the user does not have permission to view it
So although you can add comments during a transition, there has not been the expectation that the REST API would return to you the ID of that comment in that situation.
I understand if either your work-around are less than desirable, however when searching through the JRASERVER project on JAC I have not yet found another other previous requests for this particular functionality out of the transition REST response.
If you like you could create a new suggestion issue in that project. I would also recommend checking out the Implementation of New Features Policy. I can't guarantee that this feature might be implemented some day, but providing a use case and an explanation of why this would be helpful to have can then at least serve as a place where other users can watch and vote on such a request.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.