Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,295,699
Community Members
 
Community Events
165
Community Groups

"Field \'resolution\' cannot be set. It is not on the appropriate screen, or unknown."

Edited

Hello Gents,
We are using integration between OpsGenie and Jira SD and I have a problem with resolving issues in Jira. I tried to google it or even find something helpful here but no success.

This is the code which suppose to handle resolving issue:

 elif mapped_action == "resolveIssue":
result_url += "/" + str(issue_key) + "/transitions"
content_params = {
"transition": {
"id": get_transition_id(headers, result_url, "Resolved", token)
},
"fields": {
"resolution": {
"name": "Done"
}
}
}

(Above code looks better in script in terms of spacing)

Permissions for the user are OK. I tried to do it manually and it works normally. When I comment out those lines for fields and resolution, it resolves issue but with resolution as "Incomplete" which is not acceptable. So either it ends with above error about resolution or as incomplete. I need to resolve issues as "Fixed".
Also I tried to change "Resolved" to "Resolve Issue" but it generates different error:
"errorMessages":["\'transition\' identifier must be an integer"],"errors"

Also I tried to add other 2 mandatory fields (components and assignee) but it ended up with the same error about not appropriate screen.

Creating issues works fine and adding comment too, just resolving is not working.

Added some screens as well. Jira v8.5.5. Let me know if some important info is missing.

 

Can anybody help please?

resolve_issue_python.pngresolve_issue_screen.png

 

2 answers

1 accepted

2 votes
Answer accepted

Problem solved. Transition ID was the problem. By default it was putting there ID 1311 which stands for "Incomplete".

In project settings - workflows I was able to find proper one for "Resolve Issue" which is in my case 2471. Afterwards I updated python code to below and resolving issues with resolution "Fixed" is working properly:

resolve_issue_python_final.png

Not sure why it takes ID 1311 by default but "hardcoding" ID 2471 solved the problem for me.

0 votes
Andy Heinzer Atlassian Team Jul 29, 2021

Hi Pavol,

I understand you are trying to use python to call REST API in Jira Server in order to transition an issue and also set a specific resolution during that transition.  While I am not an expert on using python here, I am much more familiar with Jira's REST API here.  It should be possible for you to choose the resolution during a resolution here, as it is mentioned in the documentation over in POST /rest/api/2/issue/{issueIdOrKey}/transitions 

Could you let me know what value is contained with the 'result_url' variable?  I ask because I'm concerned that we might not be calling the expected endpoint either for this endpoint or the GET endpoint that appears to be doing the lookup to find the transition id here.  That error of

identifier must be an integer

is a clear indication that the lookup to get the transition id is not returning the value in an integer format.

The other thing I have noticed from your screenshots is that your call appears to trying to set a resolution of Done.  However in your text you mentioned wanting to try to set a resolution of Fixed.  Since we can see in the screenshot there is a resolution called Fixed, let us try to change the payload to use the "name":"Fixed" value instead.

Check that and let me know, perhaps we can troubleshoot this further with a bit more info here.

Andy

Hello Andy,
First of all, thank you a lot for helping me. Means a lot to me. I am fighting with this for couple days.

what value is contained with the 'result_url' variable?:
I added below print line to find out:
print("result_url value for resolve issue: " + result_url)

Result is:
result_url value for resolve issue: https://jiratest.elkjop.com/rest/api/2/issue/FIXIT-555287/transitions

It looks fine to me. It's very similar to the result_url for adding comment. For that one there is "comment" at the end instead of "transitions"

I have a feeling those transitions are causing troubles. I added code to print content_params as well:

Content params START==========================
Content params are: {'transition': {'id': '1311'}, 'fields': {'resolution': {'name': 'Fixed'}}}
Content params END============================


Fixed vs. Done: I was just trying everything what came to my mind. Now I have there "Fixed". "Done" would be OK too I guess, certainly "Incomplete" is not OK.

Any ideas please?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
Community showcase
Posted in Jira Service Management

Jira Service Management Documentation Opportunities

Hello everyone, Hope everyone is safe! A few months ago we posted an article sharing all the new articles and documentation that we, the AMER Jira Service Management team created. As mentioned ...

307 views 0 9
Join discussion

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