Forums

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

Create a filter using REST API

Jeffrey Bistrong
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.
August 29, 2024

We merged two jira instances, and some of the filters did not copy over. I am trying to programmatically move the filters from one jira instance to another using the API and postman. However I am running into an error 

 

{"errorMessages":["There was an error parsing JSON. Check that your request body is valid."]}
This is the payload I am sending
{
"description": "na",
"jql": "project in (PB, ROCK, GD, BC, MAT, HEAT, PLAT, WS) AND status in (Closed, Done, Rejected) AND resolution in (Done, Duplicate, "Already Exists", "By Design", "Cannot Reproduce", "Won't Do", Responded) AND labels = CurrentClientConcern ORDER BY updated DESC",
"name": "Support Agent Recently Closed"
}
I suspect is has something to do with the quotes in the jql, but I am unsure how to work around it

2 answers

1 accepted

2 votes
Answer accepted
Trudy Claspill
Community Champion
August 29, 2024

Try using single quotes within the JQL around Already Exists, By Design, Cannot Reproduce, and Won't Do

 

0 votes
Jim Knepley - ReleaseTEAM
Atlassian Partner
August 29, 2024

You can escape the inner quotes with a backslash character.

{
"description": "na",
"jql": "project in (PB, ROCK, GD, BC, MAT, HEAT, PLAT, WS) AND status in (Closed, Done, Rejected) AND resolution in (Done, Duplicate, \"Already Exists\", \"By Design\", \"Cannot Reproduce\", \"Won't Do\", Responded) AND labels = CurrentClientConcern ORDER BY updated DESC",
"name": "Support Agent Recently Closed"
}

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events