The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Handle Jira WorkflowException from REST Plugin Module

Albert Cameron
August 10, 2021

Is it possible to show jira user WorkflowException from REST Plugin Module ?

A simple web fragment call a REST Plugin Module API Url. 

If the API throws a WorkflowException it is not passed to the client. Instead I get a status code 500 Error. I need to find a way to pass WorkflowException to the client as it is done in a normal postfunction . I am not sure if it is possible.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Nir Haimov
Community Champion
August 11, 2021

Hi @Albert Cameron 

Can you share your code, and share example of the requests sent to it that throws 500?

Albert Cameron
August 15, 2021
@GET
@Path("/{key}")
@AnonymousAllowed
@Produces({MediaType.MULTIPART_FORM_DATA})
public Response getMessage(@Context HttpServletRequest request, @Context HttpServletResponse response,
@PathParam("key") String issueKey) {

// Here I throw for example a WorkflowException, but this WorkflowException
// will not be shown in Jira client, instead client will get a nonsense page
// saying This page is not reachable
throw new WorkflowException("Just a test!");


return Response.ok().build();
}

It will never show the normal Jira popup I am used to when there is a workflowException