Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Transition screen to set a resolution ignored when transition is made via REST API

Daniel Ebers Community Leader Jan 11, 2022

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.

Transition.png

The screen, in my opinion, looks great as well:

screen.png

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

1 answer

1 accepted

0 votes
Answer accepted

Hi @Daniel Ebers 

 

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

Daniel Ebers Community Leader Jan 11, 2022

Hi @Sebastian Krzewiński

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

Like Sebastian Krzewiński likes this
Daniel Ebers Community Leader Jan 12, 2022

Hi @Sebastian Krzewiński

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

Like Sebastian Krzewiński likes this

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Software

👋 Looking for 15-20 volunteers to test Atlassian training content

Hi everyone! Are you interested in beta testing Atlassian University’s newest (unreleased!) training course? We’re looking for 15-20 volunteers to test our newest training course, Basic reporting...

593 views 21 25
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you