Page 1 of 1

Setting Requirement ID

PostPosted: Wed Nov 14, 2018 7:53 am
by talberi
I'm writing a script that is supposed to automatically set the ID of a requirement based on a string located in its source property. I'm using the following code:
Code: Select all
SessionManager instance = SessionManager.getInstance();
instance.executeInsideSession("apply id", StereotypesHelper.setStereotypePropertyValue(requirement, requirementStereotype, "Id", idNumber));

where idNumber is a string that I'm trying to set the requirement Id to. This code kinda works. When I run it, the "Id" field in the requirement specification does indeed show the desired idNumber. However, the ID in front of the requirement name in the containment tree does not change. How do I get the ID number displayed next to the requirement name to automatically reflect the newly set string in the "Id" field?

Re: Setting Requirement ID

PostPosted: Tue Nov 20, 2018 5:47 am
by talberi
Any ideas? I searched a little more online to see if I could find an answer. I found a post from a few years ago related to this topic, but the method used in that post appears to be deprecated in the API now, so that didn't really help.