How to get JIRA Agile issues assigned to the current sprint for the current user using the JIRA REST API?

谁都会走 提交于 2019-12-09 16:24:33

问题


I'm getting started working with the JIRA REST API. I've learned how to get all the issues assigned to the current user:

rest/api/2/search?jql=assignee=currentuser()

...now I am trying to filter those by the current sprint. I think this functionality is provided by the JIRA Agile (Greenhopper) plugin, but I can't find any documentation for it. I came across some interesting data which appears to be the identifier for the sprint that the issue is assigned to:

customfield_10005: [
  "com.atlassian.greenhopper.service.sprint.Sprint@3094f872[rapidViewId=30,state=CLOSED,name=Sprint 2014-06-02,startDate=2014-06-02T00:00:37.672-07:00,endDate=2014-06-08T11:59:00.000-07:00,completeDate=2014-06-09T10:23:13.983-07:00,id=45]"
]

...but it just looks like a serialized mess. How can I query for the issues assigned to the current sprint?


回答1:


The method you are looking for is

openSprints()

Its only working with JIRA Agile Version 6.5 or higher.

//* EDIT: Greenhopper got renamed to JIRA Agile *//

The method definition is:

Search for issues that are assigned to a Sprint which has not yet been completed. (Note that it is possible for an issue to belong to both a completed Sprint(s) and an incomplete Sprint(s).)

So this should work for you then

assignee in (currentUser()) AND sprint in openSprints()

Regards



来源:https://stackoverflow.com/questions/25210004/how-to-get-jira-agile-issues-assigned-to-the-current-sprint-for-the-current-user

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!