Forums

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

Return message in Jira out of Java (is only visible after page refresh...)

Hauke Hörhold
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 22, 2018

Hi,
I have problems with returning a message in Jira out of Java.

I made a plugin, overwriting the CreateWorklog class (the doExecute() method) when creating an issue.
After my functionalities the method ends with those lines:

[...]
if (NONE.equals(superResult))
{            
    return returnMsgToUser(getReturnUrl(), messageToUser, MessageType.SUCCESS, true, null);
}
return superResult;

And before that, there are some options to return before creating the issue, those look like this for example:

[...]
if (httpPostReq.getResponseCode() != 201)
{
    System.out.println("ERROR: Webservice-Aufruf fehlgeschlagen! Response-Code: " + httpPostReq.getResponseCode());
    return returnMsgToUser(getReturnUrl(), "ERROR: Webservice call failed! Response-Code: " + httpPostReq.getResponseCode(), MessageType.ERROR, true, null);
}
[...]

The return argument makes the method cancels the issue-creation, but the return message is not as wanted.
First, the normal return message of the unchanged function appears, but after reloading the website, my own message appears.

Why it's only visible after refreshing the Jira website? How could I change that behavior?

And another question:
What exactly is the String target (last constructor parameter) doing in returnMsgToUser? The only information I could find, is that if you put in null, it's placed in a global spot. And what else could you put in there? I have no ideas...

0 answers

Suggest an answer

Log in or Sign up to answer