It's all about the answers!

Ask a question

How could I get current user's role in script?


Di Tang (341713) | asked Apr 17 '12, 11:39 p.m.
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


permanent link
Ralph Schoon (61.4k33643) | answered Apr 19 '12, 2:38 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
That data is accessible. See: https://jazz.net/wiki/bin/view/Main/AttributeCustomization
Di Tang selected this answer as the correct answer

2 other answers



permanent link
Ralph Schoon (61.4k33643) | answered Apr 18 '12, 3:53 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
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.

permanent link
Di Tang (341713) | answered Apr 18 '12, 4:38 a.m.
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.

Your answer


Register or to post your answer.