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

Not working as expected GET rest/servicedeskapi/request?requestStatus=OPEN_REQUESTS Edited

If I try to make a request to this endpoint:

GET rest/servicedeskapi/request?requestStatus=OPEN_REQUESTS

I get both open and closed requests and when I try to make a request to this other endpoint 

GET rest/servicedeskapi/request?requestStatus=CLOSED_REQUESTS

I don't get any request. 

In the other hand making a jql request to see if it's open or closed works perfectly.

I need something that works with different workflows. 

2 answers

1 accepted

0 votes
Answer accepted

To Summarize

The problem is that you need to update the resolution field for all closed issues if you have scriptrunner then it is easy task as there is a built-in function to update the resolution based on filter.

if you don't have it you can update it by following the instruction here: HowTo: Bulk Edit Resolution

 

Note : You need to be sure that your workflow allow you to edit the closed issues.

you can do so by delete "jira.issue.editable" property from Closed transition. please follow the steps here  How do I edit closed issues?

Here I can set which resolution I want as default.

Screenshot from 2019-09-26 16-15-17.png

 

  1. Select the Jira icon  > Jira settings > Issues.
  2. Under ISSUE ATTRIBUTES, select transitions.
  3.  Select on Default in the Actions Column to set Resolution as Default

@Paolo Di Bello 

as per JIRA service Desk API

  • CLOSED_REQUESTS - Only return customer requests that are resolved.
  • OPEN_REQUESTS - Only return customer requests that are unresolved.
  • ALL_REQUESTS - Returns customer requests that are either resolved or unresolved.

try to the same name "CLOSED_REQUESTS" in your second query and let's see the results

Actually it was CLOSED_REQUESTS. I left out the _REQUESTS but it was correct in my code when I tested it. 


That's my workflow. 

Screenshot from 2019-09-20 17-34-08.png

Then can you please confirm the resolution for the closed issues. 
If the resolution is “unresolved” the issue will be considered not resolved 

I might sound dumb but I do not understand what you are talking about. How can I see if the resolution is unresolved? On the workflow or somewhere else?

@PaoloDiBello 

don’t worry, we are here to support each other.

please try to use this jql and find if there is any data retrieved 

resolution = unresolved and status = closed 

If there is result it means the issues is closed but not resolved which means it won’t return in the api for CLOSED_REQUESTS

Yes, I get results for resolution = resolved


Screenshot from 2019-09-23 09-35-16.png

How should I fix this?

I want closed to work as resolved. 

Maybe it's marking it as unresolved because one can still reopen it actually. 

ok, now we  found the problem and you need to update the resolution field for all closed issues if you have scriptrunner then it is easy task as there is a built-in function to update the resolution based on filter.

if you don't have it you can update it by following the instruction here: HowTo: Bulk Edit Resolution

 

Note : You need to be sure that your workflow allow you to edit the closed issues.

you can do so by delete "jira.issue.editable" property from Closed transition. please follow the steps here  How do I edit closed issues?

Like Paolo Di Bello likes this


I deleted "
jira.issue.editable" property from Closed transition

and then I added the Cursive Set Resolution 
Screenshot from 2019-09-23 17-17-55.png

The closed requests are showed only if I set the request to "Set Resolution". 

How can I make it that when I transition to close the request, it automatically sets the resolution of the request to done for example? So the step doesn't require you to set "Set Resolution"

There is no mean to set it automatically to "Done" as not all your request will be resolved , some might be canceled/duplicate/declined.... etc.

I recommend to make the resolution mandatory by adding the resolution field to the workflow screen when transition from "Set Resolution". the field will be mandatory.

I need to do this using the REST API so I don't know how to make it so that is mandatory.


Screenshot from 2019-09-23 17-59-16.png

You answered my question. Can you make a different answer so people can directly see it and I can mark it as answered?

I meant You need to update the workflow by adding screen to “Set Resolution” translation And this screen hold the resolution field. This will make mandatory.

you can mark the question as answered directly beside my first reply 

But your first reply doesn't answer my question. 

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

273 views 1 2
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