It's all about the answers!

Ask a question

Why Synchronize attribute is required post addition of new custom attributes in RTC?


aastha khatri (22721) | asked Dec 01 '21, 5:48 a.m.
Hi,
We are going to add a custom attribute of type Multi-select in Project Area. As part of procedure post configuring the attribute in presentation we need to synchronize this attribute for the existing workitems. We are facing a challenge as we have close to 400000 workitems for which we need to synchronize new attribute. We have written a java client using RTC client APIs to synchronize this but that also takes time.
We want to understand what will happen if we configure the new custom field in Editor presentation and do the synchronize attribute activity over a span of time say 1 week or 10 days as we have 4 million workitems to synchronize.
Will that break anything?

Thanks,

Accepted answer


permanent link
Ralph Schoon (63.3k33646) | answered Dec 01 '21, 8:05 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Disclaimer, this is a forum and not support. 

 My take on this is as follows:

  1. When a new attribute is introduced, this attribute is only added to a work item when it is created after the attribute has been defined, or if the attribute gets set for the first time manually or by the UI. 
  2. All work items that have been created before the work item attribute was newly defined do not have that attribute and no value for it. 
  3. I think work item queries using the attribute will not find work items that do not have the attribute. Reporting the same. The editor presentations will show N/A for the attribute and you might or might not be able to select a value.  
  4. Synchronize attributes checks each item, if it hasAttribute() for the new attribute and then creates the attribute (similar to (com.ibm.team.workitem.common.model.IWorkItem.addCustomAttribute(IAttribute)?) for the new attribute. 
  5. There are likely multiple ways to implement the synchronize. https://rsjazz.wordpress.com/2012/11/19/using-an-expression-to-synchronize-attributes-for-work-items-of-a-specific-type/ shows one way of doing it using updateWorkItemType.
  6. I am not sure if there would be anything that breaks, but I assume that in the areas I mention above you might get unexpected results.
Note that if you update the attributes using the API (maybe in other cases as well) updates might send a e-mail to users that are subscribed ort owner etc. You want to suppress that. If you use the Java API since 6.0 iFix3 the additional safe parameter IAdditionalSaveParameters.SKIP_MAIL exists. The value is shown below.

public final static String SKIP_MAIL = "com.ibm.team.workitem.common.internal.skipMail"; //$NON-NLS-1$
 
You can add this to the save work item to suppress mail notification for the call.

Just my 2 cents.

aastha khatri selected this answer as the correct answer

Comments
aastha khatri commented Dec 01 '21, 8:46 a.m.
Hi Ralph,
Thanks for you quick reply. So only the workitem quering based on the custom attribute will be consistent as all workitems would not have this attribute. So even if I synchronize the attributes over a span of time it wont create any problem other than querying right?
I have written the client using the same link you mentioned above.

Ralph Schoon commented Dec 01 '21, 8:56 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I believe so, the synchronize in the UI is meant to do exactly that. Please consider to use


workingCopy.getAdditionalSaveParameters().add(IAdditionalSaveParameters.SKIP_MAIL);

To suppress the e-mail notifications. This is something to consider for all bulk  operations using the JavaAPI.


Ralph Schoon commented Dec 01 '21, 8:59 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 It might be a good idea to throttle down the load of this by pausing every now and then and keeping an eye on the monitoring, just to be sure.


aastha khatri commented Dec 03 '21, 2:54 a.m.

Ok Thank you very much. I plan to do this activity over weekend when the user activity is minimum. Also I noticed that for synchronizing attributes for 3000 workitmes takes 40 minutes. So we plan to do this activity over a span of time.

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.