Unable to get data through REST call for a JQL for custom field.

Looking for this query 

Where I have one custom field is in query param ( customfeild_17941 in 'username1' ) and i need to see data for customfield_11783

 

Here is the query ( i tried both none of them working )

https://myserver.com/jira/rest/api/latest/search?jql=Type=Bug%20AND%20cf[17941]%20IN%20(username1,username2)%20&maxResults=500&fields=summary,duedate,issuetype,priority,cf[11783],status

 

https://myserver.com/jira/rest/api/latest/search?jql=Type=Bug%20AND%20customfield_17941%20IN%20(username1,username2)%20&maxResults=500&fields=summary,duedate,issuetype,priority,customfield_11783,status

 

when i am putting in browser, both are working , but i am making golang call , it is not working . It is not issue with golang as other simple JQL without parameter , it is working "https://myserver.com/jira/rest/api/latest/search?jql"

 

Can you please let me know what could be the issue ? 

 

 

 

 

 

 

 

1 answer

This widget could not be displayed.
Warren Levy Community Champion Sep 21, 2017

Hi Utpal

Have you tried just the JQL part directly in Jira's issue filter? Check that it works there, because "text" custom fields can't be queried for content.

If I set up a text custom field, I can use cf is EMPTY or cf is not EMPTY, but I get an error if I try cf = "fred" or cf != "fred" or cf in ("fred", "notfred").

You are able to query date fields and numeric (I think)

Thanks for reply !

I have tried that , it works , while I apply to JIRA

Type=Bug  AND cf[11783] IS NOT EMPTY AND "Dev Lead" = utpal

But when i am doing through HTTP POST It's not taking the JQL part , I can see only fields in the request are coming but filtering is not working 

var rawJsondata = `{\"jql\":\"(Type=\"Bug\" and cf[11783] IS NOT EMPTY  and \"Dev Lead\" IN (utpal"))\" ,\"startAt\":0,\"maxResults\":100,\"fields\":[\"summary\",\"duedate\",\"issuetype\",\"priority\",\"cf[11783]\",\"status\"]}`

data := new(bytes.Buffer)

json.NewEncoder(data).Encode(rawJsondata)

resp, err = client.Post(url,"application/json; charset=UTF-8", data)

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Apr 22, 2018 in Jira Software

How-to setup a secured Jira Software 7.9.0 on Ubuntu 16.04.4 in less than 30 minutes

...PermissionsStartOnly=true User=www-data Group=www-data ExecStart=/opt/jira/bin/startup.sh ExecStop=/opt/jira/bin/shutdown.sh TimeoutStartSec=120 TimeoutStopSec=600 PrivateTmp=true [Install] WantedBy...

1,466 views 10 12
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you