It's all about the answers!

Ask a question

How to Set an Attribute Value Dynamically


Kurtulus YILDIRIM (681019) | asked Sep 06 '21, 3:00 p.m.
 Hi,
My customer has a request to set a value of an EWM/RTC attribute dynamically. They have two work item types; WITypeA and WITypeB. WITypeA is a standard type like defect, story, ... On the other hand, WITypeB is a catalogue type which means the customer uses it to define a system/subsystem/. Basically means, it is similar to EWM category/filed against but has more information on it, a workflow and a limited number of total records. An enumeration attribute (WITypeA_Attribute1) on WITypeA has exactly the same values as WITypeB records but is not programmatically dependent on WITypeB. I mean the customer manages values of WITypeA_Attribute1 and records of WITypeB manually.
The request is to set another attribute (WITypeA_Attribute2) value according to the value of WITypeB_Attribute1 when WITypeA_Attribute1 changes. I mean when the user changes the WITypeA_Attribute1 value, the code will find the same record on WITypeB, read the WITypeB_Attribute1 value and set the same value to WITypeA_Attribute2 dynamically.
When I investigate the options, I found;
- (I think) JavaScript API doesn't have the capability to query another WorkItem type.
- Work item Operation Advisor only works while the saving process starts/occurs, not attribute value changes.
Could you please guide me on which EWM/RTC API is best to tackle that request? Is there an example that I can use?
Thank you in advance and have a nice day.

Accepted answer


permanent link
Ralph Schoon (63.1k33645) | answered Sep 13 '21, 7:36 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Kurtulus,

first of all, you provide some kind of implementation description and not, what the intended business use case is. Based on this here my answer.

1. It would be possible to use a Reference presentation instead of using the enumeration. See https://rsjazz.wordpress.com/2013/12/17/using-reference-presentations-to-create-links-and-show-linked-work-items-in-rtc/ .
2. It might be possible to use a work item attribute of type WorkItem instead of the enumeration and simplify the whole use case.
3. It might be be possible to use a Java based attribute customization (calculated value) to achieve what you want. See https://rsjazz.wordpress.com/2013/06/26/attribute-customization-java-based-value-providers-conditions-and-validators/ .
4. A follow up action/participant would be able to read the attribute values of a work item during the work item save operation, detect if a specific attribute is changed. It can search for work items and read values from these work items  and execute work item attribute changes on the initial work item (or even the other work item). See https://rsjazz.wordpress.com/?s=participant&submit=Search especially see the EWM Extensions Workshop https://rsjazz.wordpress.com/2016/07/15/build-on-state-change-work-item-save-participant/
Kurtulus YILDIRIM selected this answer as the correct answer

Comments
Ralph Schoon commented Sep 13 '21, 7:37 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
1 and 2 would simply replace the enumeration by using the actual referenced work item.
3 and 4 would require to search for the referenced work item and get the data you want.

One other answer



permanent link
Ralph Schoon (63.1k33645) | answered Sep 08 '21, 5:21 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 Kurtulus, search my rsjazz blog for „Follow up action“ or „Participant“.


Comments
Kurtulus YILDIRIM commented Sep 08 '21, 6:58 a.m.

Hi Ralph,

I already checked your blog but it doesn't cover my requirement above.
Thank you.

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.