I can get the status of an issue, but I can't figure out how to get the status category (To do, In Progress, Done).
Can someone please help?
Nic - if you're out there.
If you've got the status, you're half-way there!
Given an issue, I've used
def sc = issue.getStatus().getStatusCategory()
You'll probably want to try
and so-on for the actual data
Thanks!!!!! Man google was NO help on this one. Can't believe it hadn't been documented before anywhere.
Is there a primary reference for Groovy script methods? I found one page but it was really hard to search and navigate so I wasn't able to drill down to anything related to category.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's not really Groovy doing this. The "def" bit is Groovy, letting you create an untyped variable to work with later, but the rest is Java calls into the JIRA AP.
If you go to https://docs.atlassian.com/jira/server/ you'll see the java documentation for JIRA's API.
In the code, you've got an "issue" object, so go find the class for "issue" in the "all classes" panel and click on that. The detail panel will show you the available methods and what they return. So getStatus() returns a Status object, so you click on that to see that object and then you'll see the getStatusCategory() call fetches a statusCategory and that has the three get methods I suggested trying!
I suspect Google was less help than usual because the getStatusCategory call is relatively new and may not have been widely posted yet.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nic Brough -Adaptavist- thanks for that even in 2019
Not sure if its funny or sad, but if you run
issue.getStatus().getStatusCategory().getName()
over an issue which is in Status which is "Done" Status Category you will get a string "Complete" ¯\_(ツ)_/¯
Thanks man!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, that is really odd. As you say: ¯\_(ツ)_/¯
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We can use getTranslatedName() to get exact category i.e "Done" instead of "Complete"
issue.getStatus().getStatusCategory().getTranslatedName()
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.