I'm using the Jira Rest API to get issues a user can access. My goal is to limit the requested issues to the ones I need only. I only need Sub-Tasks which have an issuetype-id of 8.
Is there a possibility to limit the response to only provide issues with this issuetype-id (or name)?
This is my request so far
/rest/api/2/search?jql=assignee=currentuser()&fields=key,id,issuetype,project,subtasks,summary,status
(using Basic Authentication) which is working fine.
The Response looks like this:
{
"expand": "schema,names",
"startAt": 0,
"maxResults": 50,
"total": 42,
"issues": [
{
"expand": "operations,versionedRepresentations,editmeta,changelog,renderedFields",
"id": "---",
"self": "...",
"key": "PROJECT-NR",
"fields": {
"summary": "TaskSummary",
"issuetype": {
"self": ".../rest/api/2/issuetype/8",
"id": "8",
"description": "The sub-task of the issue (IT)",
"iconUrl": "...avatarType=issuetype",
"name": "Sub-Task",
"subtask": true,
"avatarId": 14546
},
"project": {...},
"subtasks": [],
"status": {...}
}
}
},
{[...]
and so on...
Appreciate every help, thank you very much! :)
Hi,
for this api you can use below filter for status or type of issue:
rest/api/2/search?jql=issuetype+in+(Bug,+Epic)+AND+status+=+In Progress
and for pagination or improve your performance you can use maxResult and page at end of the url param
Hi,
you can filter your search by issuetype name, not id.
Your request should be:
/rest/api/2/search?jql=assignee=currentuser%28%29%20AND%20issuetype=Sub-task&fields=key,id,issuetype,project,subtasks,summary,status
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Did my line worked for you (for Sub-task)?
What is the error you get, it should work for any issue type.
of course if you want to filter multiple issue types at once, it should be:
/rest/api/2/search?jql=assignee=currentuser() AND issuetype in (Sub-task, task, test)&fields=key,id,issuetype,project,subtasks,summary,status
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I didn't get an error, I just still get all issues but I only want to get sub-tasks.
I know I could filter them programmatically but I want to increase the performance of my application so I want to limit the results of my requests to what I really need. If there is no solution to do this, I will filter it programmatically but if there is that would be great :)
/rest/api/2/search?jql=assignee=currentuser()&issuetype=Sub-task&fields=key,id,issuetype,project,subtasks,summary,status
This is the request I sent...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is the way to get it filtered and not getting all issues...
It sounds weird you get all issues on and not only Sub-tasks (for me it works fine)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Isn't there a flag that makes a Subtask a Subtask? I mean even if its name is different?
I can't remember where that is, but I remember having seen that.
So maybe all of your tasks are marked as Subtasks, then it would make sense.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.