I need jQuery to get the list of bugs which has more than 1 label
Hi @Vimali ,
In Jira Cloud, to retrieve issues with more than one label using jQuery, you can make use of Jira's REST API. The basic approach involves:
Here’s how you can do this with jQuery:
$(document).ready(function () {const jiraUrl = "https://your-domain.atlassian.net/rest/api/3/search";const username = "your-email@example.com";const apiToken = "your-api-token";
const jql = "issuetype = Bug AND labels is not EMPTY"; // Jira Query Language (JQL)
$.ajax({url: jiraUrl,method: "GET",headers: {"Authorization": "Basic " + btoa(username + ":" + apiToken),"Accept": "application/json"},data: {jql: jql,fields: "labels"},success: function (response) {const issues = response.issues.filter(issue => issue.fields.labels.length > 1);console.log("Bugs with more than 1 label:", issues);},error: function (error) {console.error("Error fetching issues:", error);}});});
Regards, Harshit
Thanks.
Is it possible to write just a jql to get the list of bugs with more than 1 label. labels is not supporting operators
It looks like you're new here. Sign in or register to get started.