Using JMWE 5.7.0 and JIRA 5.4.2
No post-function seems to be executed. I've verifed Workflow and permissions and everything is OK.
I've tested post-functions within the Groovy editor and they don't throw any error.
Any idea?
You first need to make sure you have published your workflow.
After that, you should check the Jira log file for errors.
Also, what do you mean by you "tested the post-function in the Groovy editor"? Which post-function are you using? And are you using some Groovy code in it?
Ah, ah. You give me an idea: look in log files !!!
I don't have access to the server, so I need to ask our admins. I'll come back with answer about log files.
For post-functions, I'm using groovy script to set value to fields. In the editor, there is a button to test the script and I've no error when testing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You don't have to wait for your admins, you can use the Last Log app to access your log files.
Are you using the Set Field Value post-function? Can you share your script?
Alternatively, you can open a support request here: https://innovalog.atlassian.net/servicedesk/customer/portal/8
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for this plugin. I'll ask our admin to deploy it on our production server !!!
I've just uploaded it to my test server and it seems to work fine. But I don't know what to search. Nothing found looking for "JMWE" or "innovalog"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Here's a postfunction I use
The value of field Analysis responsible of the current issue will be set to the value of the following Groovy Expression
import com.atlassian.jira.component.ComponentAccessor;
log.warn("JMWE post-fct -- Submitted-->Analyse-->Analysed -- If Analysis responsible is not set then set it to Current User");
log.warn("Setting Analysis responsible to " + ComponentAccessor.getJiraAuthenticationContext().getUser());
return ComponentAccessor.getJiraAuthenticationContext().getUser();
(unless the field already has a value).
Analysis responsible is a custom field
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FYI, the current user is available directly as the
currentUser
variable (no need to use the JiraAuthenticationContext)
And since you added WARN-level logging, you see definitely see these log messages in the Jira log file. Are you sure you deployed the workflow draft?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unless your admin disabled WARN-level logging on your Jira instance, you should definitely see either your log.warn messages or, if your script is incorrect, an ERROR that include "com.innovalog.jmwe" in its stack trace. You can try using log.error instead to see if that changes anything.
What is the type of your Analysis responsible field? Also, did you try without the "Set only if empty" option)? That would totally explain the absence of any log entry, if the field is not empty when the post-function runs.
Also, you might want to add another post-function (preferably not one of JMWE's) to make sure there is no confusion of transitions (you should see the outcome of that other post-function when you transition the issue).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK. Found that post-functions are executed if all mandatory fields are filled up before doing transition. the post-function to set values for mandatory fields seem to be processed after "mandatory" check :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Post-functions are executed post transition (hence the name). During a transition, things happen in this order (on Jira Server at least - Cloud is different):
What is it exactly that you were trying to do? Update the issue before the transition screen is displayed? Unfortunately, that is not possible with workflow extensions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I search for an issue. Then, I click "Analyse" (Workflow button at the top of an issue), I've got a new screen with mandatory and non mandatory fields.
One mandatory custom field is "Analysis Responsible". I need to set it to current user if the field is left empty by the user when clicking "Analyse" on the bottom right of the screen.
Hope this is clear enought
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm sorry. Seems that I've not read correctly your explanations. So mandatory fields are check before post-function. This is my problem.
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But then, why make the field mandatory if the user doesn't need to enter a value?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is a good question !!!! Someone provides me the configuration and made a mistake. The fields should not be mandatory if using post-functions to set them !!!
Thanks again for your help :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Strange. Works for one workflow but not for another one. Keep looking in log file and configuration if I made something wrong
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.