Hi Community,
yesterday I came across a case where I do not recall how the details are intended to work.
The setup is a workflow where on "resolve" transition a screen is in place. This screen has the system field "resolution" on it.
That means: every user that is to execute the resolve transition is asked for a resolution - this works for many years, all good.
The screen, in my opinion, looks great as well:
But it works only if they are doing the transition directly in Jira. Via REST API Call the resolution is never set per default (nor is the transition failing). The following example shows it better:
curl -D- -u $jirauser:$jirapass -X POST --data '{"transition":{"id":"5"}}' -H "Content-Type: application/json" https://jira/rest/api/2/issue/1234567/transitions
The above example will transition the issue to resolved state, however the resolution stays "Unresolved"
curl -D- -u $jirauser:$jirapas -X POST --data '{"transition":{"id":"5"}, "fields": {"resolution": {"name": "Fixed"}}}' -H "Content-Type: application/json" https://jira/rest/api/2/issue/1234567/transitions
The above example will transition the issue also correctly to resolved state and the resolution is set to "Fixed" as expected.
So, this is a more theoretic question (and if I remember something wrong from the past).
Understandable a screen cannot be accessed/used by REST API, sure.
But should the transition not rather fail or set a (whatever) default rather than put a resolution of Unresolved to an issue that is resolved? At least the behaviour seems not to be consistent with user interface (there a resolution MUST be set).
Is there a JAC on that perhaps? I could not find any.
Thanks a lot in advance!
Cheers,
Daniel
Resolution field is default Jira field and it always is required when it appear on screen via GUI and it won't be required via rest api because making tranistion via REST API don't respect screens.
Only workaround what I see is set validator on tranistion with resolution field. Via GUI it will be "double required" but user will not see this. Via REST API user will get error that resolution is required.
Regards,
Seba
I agree - a validator could make sense here.
Nevertheless the current handling seems to me not being consistent with what users see in user interface.
Thanks for checking in =)
Regards,
Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just wanted to share we got a Bug in JAC on that:
https://jira.atlassian.com/browse/JRASERVER-73185
Nevertheless, I will accept our answer because the hint with the validator could be useful for others.
Cheers,
Daniel
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.