Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Paolo Di Bello September 20, 2019

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
Mohamed Adel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 24, 2019

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?

Paolo Di Bello September 26, 2019

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
0 votes
Mohamed Adel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 20, 2019

@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

Paolo Di Bello September 20, 2019

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


Paolo Di Bello September 20, 2019

That's my workflow. 

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

Mohamed Adel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 20, 2019

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

PaoloDiBello September 22, 2019

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?

Mohamed Adel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 22, 2019

@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

Paolo Di Bello September 23, 2019

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. 

Mohamed Adel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 23, 2019

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
Paolo Di Bello September 23, 2019


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"

Mohamed Adel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 23, 2019

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.

Paolo Di Bello September 23, 2019

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

Paolo Di Bello September 23, 2019

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

Mohamed Adel
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 23, 2019

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 

Paolo Di Bello September 24, 2019

But your first reply doesn't answer my question. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events