It's all about the answers!

Ask a question

Re: Running plugin code on all existing workitems


VK L (8177155159) | asked May 18 '12, 11:19 a.m.
Is it possible to run the plugin code on all workitems in a project area -> to implement a particular attribute change - based on a condition?
Is there any method to retrieve all the workitems in a result and then operate on them?

Thanks.

10 answers



permanent link
sam detweiler (12.5k6195201) | answered May 18 '12, 2:23 p.m.
I don't think you can do this effectively from a plugin.

maybe a java application...

but in either case many of the apis u need are not exposed publicly..

permanent link
SEC Servizi (97123660) | answered May 21 '12, 3:10 a.m.
You could try to synchronize all work items, as detailed in the Jazz article https://jazz.net/library/article/529:
Fortunately, RTC has a built-in feature called Synchronize Attributes that makes it possible to apply your changes to a defect's "shape" to previously-created work items.

The first thing to do is to create a work item query that identifies the work items to update.
Once you have created and executed your query strategy, highlight those needing the attribute to be added as shown in the following screen shot:
https://jazz.net/library/content/articles/rtc/2.0.0.2/cool-hidden-features/cool-hidden-features-pt2/images/image003.jpg
Notice that the "Synchronize Attributes" option will appear only if you right-click the work item icon... :?

Cheers.

permanent link
VK L (8177155159) | answered May 21 '12, 5:24 a.m.
Thanks sec. Currently we have a requirement - where we are changing the data type of a particular attribute from "Medium HTML" to "Large HTML". So in this case, i think we need to create a new attribute and map it back to the presentation? How can we retain the previous data after the mapping?

Thanks

permanent link
SEC Servizi (97123660) | answered May 21 '12, 10:30 a.m.
Why don't you simply change the attribute type in your process configuration?
https://jazz.net/library/content/articles/rtc/3.0/workitem-customization-attributes/images/default-value-instructions.png
See Jazz articles https://jazz.net/library/article/129 and https://jazz.net/library/article/537...

permanent link
sam detweiler (12.5k6195201) | answered May 21 '12, 10:40 a.m.
I have not been successful at changing types via the process config source when there are existing workitems with these data elements.

the elements in the database do not change

permanent link
SEC Servizi (97123660) | answered May 21 '12, 10:45 a.m.
Well, I think you have to change the attribute type in the process configuration and resynch the work-item attributes... :wink:

permanent link
VK L (8177155159) | answered May 21 '12, 11:56 a.m.
Thanks sec...I will try this out...

permanent link
sam detweiler (12.5k6195201) | answered May 21 '12, 12:00 p.m.
Well, I think you have to change the attribute type in the process configuration and resynch the work-item attributes... :wink:


that was the process I was not successful at

permanent link
VK L (8177155159) | answered May 24 '12, 2:19 a.m.
Relating to this, i have considered the below option:
1. create a new attribute - of type large html, and add it to presentation as well.
2. export workitems. copy all the data from the old attribute to the new attribute.
3. Import the workitems.
4. Delete the old attribute.

Resynch would create both the attrbutes meaning the new attribute would be empty in the old items. and the direct change of default value to large html wouldnt work as the attribute type is medium html and hence does not produce any effect.

permanent link
sam detweiler (12.5k6195201) | answered May 24 '12, 8:19 a.m.
I believe that you will now have TWO workitems for each you exported/imported, and the new workitem will have a new ID. I do not think you can import OVER existing workitems..

so, you would have to archive (we are not allowed to delete in our configuration) the old workitems. and everyone would have to understand the new ids if they mattered.. ,
also export/import doesn't do a good job of saving links to other info.

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.