Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

How to update rank of multiple work items ?

Hi

Is there anyway to massively update the rank of multiple work items? Or is dragging and dropping the work items in the backlog plan the only option?

Can the massive update be done in a programmatic way ? The solution does not have to involve Excel. I will consider any option.

Regards
Naveen

0 votes



3 answers

Permanent link
In general ranking is something manual, to provide a custom order in a plan. So it is a manual process. The attribute value is calculated by the plan.

In 4.0RC1 I was able to rank work items and create a query that displays the coumn "Rank (relative to priority)". The column values look like: priority.literal.l11 O00005

You could try (on a test system) to export to CSV, modify the rank and re-import with update. If that does not work the only chance I see is using the plain java client libraries and try to write a tool that modifies the rank, if possible.

0 votes


Permanent link
Hi Ralph,

Thanks for the suggestion! I work with Naveen Arora. I tried to update ranks by importing them from Excel, but it did not work in our current RTC version 3.0.1.1. Could you please provide more information about the java client libraries that you mention in your post?

Thanks,

Lee Gemma Fu-Sun
CA technologies
APM Shared Services
Associate Configuration Management Engineer
Tel: +1-650-534-9555
Mobile: +1-415-335-5629
Gemma.Fu-Sun@ca.com

0 votes


Permanent link
Hi Lee,

the article https://jazz.net/library/article/807 talks about using the plain Java Client Libraries.

https://jazz.net/wiki/bin/view/Main/ProgrammaticWorkItemCreation talks about programmatic work item creation. There is a code example to be used with the plain java client libraries.

If you use that as a starter and modify it you would change the WorkItemInitialization inner class to something like:


private static class WorkItemModification extends WorkItemOperation {

private String fAttributeID;
private Object fValue;

public WorkItemModification(String attributeID, Object value) {
super("Initializing Work Item");
fAttributeID=attributeID;
fValue=value;
}

@Override
protected void execute(WorkItemWorkingCopy workingCopy,
IProgressMonitor monitor) throws TeamRepositoryException {
IWorkItem workItem = workingCopy.getWorkItem();
ITeamRepository teamRepository = (ITeamRepository)workItem.getOrigin();
IWorkItemClient workItemClient= (IWorkItemClient) teamRepository.getClientLibrary(IWorkItemClient.class);

IAttribute attribute = workItemClient.findAttribute(workItem.getProjectArea(),
fAttributeID, null);
if(null!=attribute){
if(workItem.hasCustomAttribute(attribute))
workItem.setValue(attribute, fValue);
}
}
}


And call it like this:


int id = new Integer(idString).intValue();
IWorkItem workItem = workItemClient.findWorkItemById(id, IWorkItem.SMALL_PROFILE, null);
WorkItemModification operation = new WorkItemModification("anAttributeID","someValue");
operation.run(workItem, null);


I have not tested this code!
You need to look up the attribute ID for RankByPriority (if it exists as attribute), there is no direct setter.

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,954

Question asked: May 21 '12, 4:27 p.m.

Question was seen: 4,275 times

Last updated: May 21 '12, 4:27 p.m.

Confirmation Cancel Confirm