How to filter labels based on query or project in rest api 3?

when I search in meta data I can able to see only 1.0 version. is there any update on this?

URL Available in meta data: https://domain.atlassian.net/rest/api/1.0/labels/suggest?query={Query}

Hello @DhineshDhanapal

You seem to have confused two totally different things. That URL you have provided is to one of the ancient v1.0 endpoints. Development of them ended close to a decade ago, so there is nothing to ‘update’.

The creation of an equivalent v2 REST API endpoint happened waaay back in 2015, as per JRACLOUD-42686

For the v3 REST API, you should be looking up auto complete data for the Labels field via the Get field auto complete suggestions endpoint, like this:

GET https://domain.atlassian.net/rest/api/3/jql/autocompletedata/suggestions?fieldName=labels

@sunnyape Thanks for your reply. but the autocomplete url still the above mentioned in the createmetadata call response body. So I raised this concern. The purpose of this call is to get the meta data about an issue to be created with particular issue type.
URL: https://domain.atlassian.net/rest/api/3/issue/createmeta?projectIds=10001&issuetypeIds=10000&expand=projects.issuetypes.fields

The labels section in the response is as follows
fields: { labels: {
“required”: false,
“schema”: {
“type”: “array”,
“items”: “string”,
“system”: “labels”
},
“name”: “Labels”,
“key”: “labels”,
“autoCompleteUrl”: “https://domain.atlassian.net/rest/api/1.0/labels/suggest?query=”,
“hasDefaultValue”: false,
“operations”: [
“add”,
“set”,
“remove”
]
}}

please help me to get a solution for this.

Sorry @DhineshDhanapal but I really cannot grasp what you mean.

You have now changed topic and are talking about getting metadata about the fields of a particular issue type, not filtering labels based on a query, and are citing a totally different endpoint that does a totally different thing. You have provided a JSON response from a typical query to that endpoint and you seem to be inferring there is something wrong with the autoCompleteUrl object within it.

Perhaps if you described the entire use case you have for that JSON response from that endpoint and what, specifically, you see as being wrong with the autoCompleteUrl object in that response ( IE, how is the current value in the autoCompleteUrl object causing your application / code to not work) such that you feel needs to be ‘solved’, and what that solution would result in.

Thanks @sunnyape my use case is as below:
I need to create an dialog to create issue with few restrictions(user should not able to change issuetype, project - which are not possible in jira cloud’s create issue native dialog) using create issue API.

For that, i need to pass mandatory fields. to get the mandatory fields list, i am calling get create meta data details api call using https://domain.atlassian.net/rest/api/3/issue/createmeta?projectIds=10001&issuetypeIds=10000&expand=projects.issuetypes.fields in this, when I check the labels, I saw the auto complete URL as mentioned above.

Why I need that auto complete URL means, I can create dynamic UI Based on the response from get call response. Let me know if you need more detail on this.

Sorry, but I haven’t the faintest idea how the URL to the autocomplete suggestion API for the labels field, or a GET call to that endpoint itself, would provide any useful information about whether or not that field, or any other field, was or wasn’t mandatory for a particular issue type in a particular project.

I can’t help any further, as what you’re describing makes little sense to me. Maybe someone else here can work it out.

Have fun.