How could I get current user's role in script?
I use RTC in 3.0.1.3 and I using scripts for attribute customization in work item to set some attribute default value. But I have no idea how to get current user's role in script. Is there any way to get current user's role in script, I really need to set one attribute default value depends on it. Can you provide some API and some example please? Thank you very much!
Accepted answer
2 other answers
I use RTC in 3.0.1.3 and I using scripts for attribute customization in work item to set some attribute default value. But I have no idea how to get current user's role in script. Is there any way to get current user's role in script, I really need to set one attribute default value depends on it. Can you provide some API and some example please? Thank you very much!
Hi,
the Wiki page states that there is only limited access to IItem objects. As far as I know the Contributor objects are not really exposed in scripts. So far I have not been able to access more than the ID that is returned as the string. I can't access the name or any other information. My current assumption for scripts is, if you have to do more than the most basic operations, use preconditions or follow up actions instead.
I use RTC in 3.0.1.3 and I using scripts for attribute customization in work item to set some attribute default value. But I have no idea how to get current user's role in script. Is there any way to get current user's role in script, I really need to set one attribute default value depends on it. Can you provide some API and some example please? Thank you very much!
Hi,
the Wiki page states that there is only limited access to IItem objects. As far as I know the Contributor objects are not really exposed in scripts. So far I have not been able to access more than the ID that is returned as the string. I can't access the name or any other information. My current assumption for scripts is, if you have to do more than the most basic operations, use preconditions or follow up actions instead.
thank for your reply, I will try preconditions later.
But I still feel interested in how to get more information than workitem attribute info, such as the number of the story. I think function like this will be very useful.