Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

getting the status list of a particular project

ashen shanaka January 6, 2013

Hi

i have a project in jira that has other statuses that i manually created which is only valid for that project. in my app i want to show the users the current statuses and the tasks in them.for that i need to get the status list of the project.but when i use this

https://'.$this->host.'/rest/api/latest/status

it returns every status available in jira. i want to get all statuses of that particular project..is there a way?

7 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Answer accepted
Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2013

See ashen shanaka,

With existing interfaces of JIRA, this is not possible. If you really need to make a accurate I have to repeat - you need to make a plugin to expose a new interface. Otherwise The closest options are:

  1. Get all status, ignore probably the initial couple of statuses as they are the standard ones and use the remaining
  2. If the account by which you are accessing JIRA from your app has administration rights, you can load the view page of the Workflow in JIRA in code (HttpRequest) and do a regular expression match and find the valid statuses (remember admin rights, which I doubt)
  3. Keep an external hosted file which is manually updated if you change your JIRA workflow (which will be very rare) and let the App read from it. So this will avoid hard-coding the status in the App and give you flexiblity to change later.
  4. Just hardcode in the App. The status will hardly change for your recruitment workflow once it stabilitizes
  5. Show all the statuses
ashen shanaka January 31, 2013

renjith

i accepted your answer because i ended up hardcoding the statuses like you said.:) thanks for all the answers guys.appreciate it..

0 votes
wan.looi August 19, 2019

Hello people, I am integrating Jira Cloud with MS Teams and ran into some issues with JQL query. I have so far gotten all Jira Cloud's notifications to show in a MS Teams channel, but I wanted to restrict only notifications from Jira Cloud ServiceDesk to appear in Teams with the following JQL query:

 

project IN (COPSSVC) AND status NOT IN (Closed, Resolved)

jira.png

But in the UI when we keyed in COPSSVC, the description and the key popped up as “CloudOpsServiceDesk (COPSSVC)”, so I ended up changing my query to

 

project IN (COPSSVC, CLOUDOPSServiceDesk) AND status NOT IN (Closed, Resolved)

 

After I applied the changes, I am no longer getting notifications in MS Teams from ANY project. I suspect the syntax may be incorrect. Hope someone can help pinpoint where I did wrong. Ideally, I wanted to show ALL status for COPSSVC with just

project IN (COPSSVC, CLOUDOPSServiceDesk)

 

but it doesn't work. Any help will be appreciated.

0 votes
Sam Hatoum April 8, 2016

It IS possible. Just not obvious and undocumented.

JIRA has a workflow designer that allows you visualize the state machine.

If you open the chrome tab and look at the network, you can see a JSON file that contains the states for a given workflow.

  1. Right click the request to "workflows?..." and use the "Copy as curl"
  2. Paste the command into a terminal and you'll get something like this:

{
  "isDraft": false,
  "layout": {
    "statuses": [
      ...
    ],
    "transitions": [

      ...
    ]
  }
}

 

The endpoint is this:

https://<HOST>/rest/workflowDesigner/latest/workflows?name=<WORKFLOW_NAME>

 

And you need to authenticate with a bunch of headers that you can see in the curl command. You would also need to check which workflow your project is using. So 2 command should do the trick for you.

 

Sorry this took 3 years to respond smile

0 votes
Phillip Ponzer [Cprime]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 20, 2013

In case you want to do this using the JIRA API, there's this (obtainable from a WorkflowManager):

https://docs.atlassian.com/jira/latest/com/atlassian/jira/workflow/JiraWorkflow.html#getLinkedStatusObjects()

0 votes
C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2013

hi let me try to help...

as i read your request....i think you chose the wrong Option

please refer to http://docs.atlassian.com/jira/REST/latest/#id227713 and find the explanation of the result when you call "/rest/api/latest/status"

-> Returns a list of all statuses

i suggest using jql in the api request...such like

$YOUR_HOST_HERE/rest/api/2/search?jql=project="KEY"+AND+status+in+("reopened","waiting for feedback")

i am not 100% sure but i think filters can be called by REST too...

ashen shanaka January 6, 2013
https://myhostname/rest/api/latest/search?jql=project=REC
is this what you want me to try?
i tried but it returns all the tasks in that project.and thats not what i want
C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2013

yes...

of course...cause you only set the project....use more options like i did in my example...

myhostname/rest/api/latest/search?jql=project=REC+AND+STATUS+NOT+IN+("status to hide","another status to hide")

ashen shanaka January 6, 2013

but man i need the names of the statuses.not tasks in a status.i dont think you understood my prob? please read the comments aswell..

C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2013

you're right. my bad. sorry man

you only want a resolution using the api or could it be a dashboard gadget as well?

ashen shanaka January 6, 2013

i dont know what a dashboard gadget is...but what i need is....in jira we can keep different workflows to different projects.i want to get the statuses of a particular project.not the statuses of all jira.think you can help?

ashen shanaka January 6, 2013

ok....how do i do this?..and specially how do i get this info to my system? and if there is no tasks in a particular status, will it still show in the pie chart?

C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2013

it can be done with a "Pie Chart" Gadget.

you select a project or a filter...and the "Statistic Type = Status"

this will show you a pie cart with a summary of current issue states in that project. the possible states depend on the workflow of course....

it looks like this and could be finetuned using a filter as well. you can put this on a new dashboard (i.e. call that one Reports)

ashen shanaka January 6, 2013

wait..does this show transitions? because thats not what i want.you said "the possible states".thats why im asking

C_ Faysal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2013

no transitions...

possible states per project are set in the assigned workflow...yes i said that cause in the workflow you manage all steps and their states like you already know.

if there is no tasks in a particular status, will it still show in the pie chart?

nope. f.e. if my project has no issue that is in status "Open" then "Open" won't appear in that chart.

the screenshot i uploaded is from a Dashboard gadget called "Pie Chart"

https://confluence.atlassian.com/display/GADGETS/Adding+a+Gadget+to+your+Dashboard

i suggest creating a new dashboard first. share it with your users and put all the things you want them to see on that dashboard.

please note...if you use any filters to be used by the dashboard they have to be shared as well.

0 votes
Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2013

There is no concept of status only for a project in JIRA. Statuses are global in JIRA.

A workaround, would be to evaluate all the workflows that are used in the projects, find the status that is present in that and return that. I do not think there is any existing REST interface that can return this. You may need to write a plugin to expose a new interface to return this.

GreenHopper does this for it's column mapping configuration by checking the workflows.

ashen shanaka January 6, 2013

i dont think you got my question. what i need is to get the all workflow status values in a particular project.for ex: in my project there are statuses like interviewed, short listed, recruited and so on. and in other projects the usual open resolved like wise. i need to get the interviewed(etc) statuses.not the open and resolved statuses. and if your answer is still like that, could you tell me a way to get around this without having to make a plugin. modifying information from another rest interface and getting what i want is what im looking for. thanks

Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2013
My answer actually remains the same. Can you tell me the final use case?
ashen shanaka January 6, 2013

use case as in?

ashen shanaka January 6, 2013

well iam creating jira tasks from the mails i get to my gmail.all are been defaultly assigned as OpenCV status. when the user logs into the system it shows the current tasks created.and he can navigate to other statuses by selecting a dropdown.i want that dropdown to have all the statuses in that particular project.thats why i need the all the statuses available for that project.right now it shows statuses from jira.as in open resloved and etc are in there as well.i want just the statuses in that project to be displayed there. i can get it done by css or php. but if i can use rest interface to get that info, it would be easy to develope this app to other needs aswell.otherwise i wil have to keep doing that css or php changes to every other scenario becasuse i will have to make it hardcoded.

Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2013
I meant what is this app trying to achieve with those statuses?
Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2013
Okay, then it is really not status of the project, rather the transitions that are possible from the current status of the issue. You can do the rest call issue-key/transitions that will tell you this. it will actually give you even the icon to use and the destination status.
Renjith Pillai
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2013

Got it, am sorry, no further inputs.

ashen shanaka January 6, 2013

no man..im not showing them what transitions are possible.im showing them all the statuses that there are in that project and letting them choose them so that they can view what are the tasks in that particular status.for example..if i log in i get the default, tasks in the OpenCV status.if i want to see the tasks in the interview status.i just select interview from the dropdown.the transition was useful for me when i let them change the status of a task.in here im not letting them change anything.just showing an overview of all the tasks in different statuses.right now unwanted statuses like Open Resolved appears in the dropdown because the url i posted earlier returns everything.

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events