Forums

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

How to show normal Jira popup from REST plugin Module in case of WorkflowException ?

Albert Cameron August 13, 2021

I wrote my own Jira Resource . 

Either you create a REST Plugin Module or a Web Resource .

But how can I return WorkflowException from my own Web Resource ??

Right now if the user calls my REST Resource and there is an Exception a 500er Error is returned without any useful information for the user being displayed as is normal the case in Jira shown by  a popup .

I hope there is way to do this.

 

P.S.

My Api has to repond the same way as Jira Api normally does when there is a WorkflowException. Maybe there is a flag that could be set

 

1 answer

0 votes
Albert Cameron August 14, 2021

So anyone not understanding my problem here some code:

@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();
}

See the comment. My goal would be to show the normal Jira Popup, but I really do not know if it is possible.

Suggest an answer

Log in or Sign up to answer