It's all about the answers!

Ask a question

Finding configured values for severity


Andy Berner (61127) | asked Jun 18 '08, 3:13 p.m.
For a custom attribute that is typed by an enumeration, I know how to find the possible enumeration values through code. But how about for standard attributes, like the "severity" enumeration---

I'm confused a bit about this---If you use the EclipseWay process, if you just look at the GUI, a Defect has a severity, but a Story doesn't (it does have a "story point" value, and it's clear how that's configured). You can easily customize what the possible values are for the severity enumeration. And you can customize whether severity shows in the presentation--so it's included in the presentation for Defect, but not included in the presentation for Story.

In the client libraries, there's a specific getSeverity() method on workitems, and an ISeverity interface that can be used to create Identifiers (values of the enum) from strings.

Does this all mean that Story work items actually do have a Severity, but it's just not shown?

Most important--how do you get through code (in advance of querying for specific work items) the possible values of severity configured in the ProjectArea's process? And more generally, find all the enumerations and their values?

3 answers



permanent link
Patrick Streule (4.9k21) | answered Jun 20 '08, 10:26 a.m.
JAZZ DEVELOPER
Thanks Patrick! That answers my question well for severity. Quick
follow up--this works ok as long as I know explicitly it's severity
I'm looking for and I can use the right property in my code. Is
there a way to get a list of all the attributes, both built in and
custom, for a ProjectArea, so that severity is just "another one
on the list"? I'm looking at this for purposes of a
configuration utility that configures "the attribute I'm
interested in", perhaps by ID, and so can treat built in and
custom the same.

The method that returns all attributes of a project area is

IWorkItemCommon#findAttributes(IProjectAreaHandle projectArea,
IProgressMonitor monitor);

Patrick
Jazz Work Item Team

permanent link
Andy Berner (61127) | answered Jun 20 '08, 10:04 a.m.
Thanks Patrick! That answers my question well for severity. Quick follow up--this works ok as long as I know explicitly it's severity I'm looking for and I can use the right property in my code. Is there a way to get a list of all the attributes, both built in and custom, for a ProjectArea, so that severity is just "another one on the list"? I'm looking at this for purposes of a configuration utility that configures "the attribute I'm interested in", perhaps by ID, and so can treat built in and custom the same.

permanent link
Patrick Streule (4.9k21) | answered Jun 20 '08, 5:46 a.m.
JAZZ DEVELOPER
For a custom attribute that is typed by an enumeration, I know how to
find the possible enumeration values through code. But how about for
standard attributes, like the "severity" enumeration---

You can get all enumeration values using
IWorkItemCommon#resolveEnumeration(IAttributeHandle attribute,
IProgressMonitor monitor). This works for both custom attributes and the
built-in severity and priority attributes.

I'm confused a bit about this---If you use the EclipseWay process, if
you just look at the GUI, a Defect has a severity, but a Story
doesn't (it does have a "story point" value, and it's clear
how that's configured). You can easily customize what the possible
values are for the severity enumeration. And you can customize
whether severity shows in the presentation--so it's included in the
presentation for Defect, but not included in the presentation for
Story.

In the client libraries, there's a specific getSeverity() method on
workitems, and an ISeverity interface that can be used to create
Identifiers (values of the enum) from strings.

Does this all mean that Story work items actually do have a Severity,
but it's just not shown?

Yes. Severity is a built-in attribute, so all work items regardless of
their type have this attribute.

Most important--how do you get through code (in advance
of querying for specific work items) the possible values of severity
configured in the ProjectArea's process? And more generally, find
all the enumerations and their values?

IAttribute severityAttribute= workItemClient.findAttribute(projectArea,
IWorkItem.SEVERITY_PROPERTY, monitor);
IEnumeration<ISeverity> severityEnumeration= (IEnumeration<ISeverity>)
workItemClient.resolveEnumeration(severityAttribute, monitor);
List<ISeverity> severities= severityEnumeration.getEnumerationLiterals();

HTH,
Patrick Streule
Jazz Work Item Team

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.