Defaulting a Contributor attribute to "Created By"
In a work item, I would like to add another Contributor attribute, which can be modified, but I would like to default value to start out being the "Created By" person. I know that "Created By" is generated by the system, is there a way to get that field on the initial creation only to get copied into this new field?
Susan |
4 answers
I went back to the original first article, and looked again at the "Default Values" section, and there is a way to specify the "Authenticated User", which would be (on a create) the CreatedBy user. Once it is set, then the default value isn't needed, so that isn't a major problem and this SEEMS to do what I want (although I think I need to get "Unassigned" out of the list).
Steps: go into Attribute Customization, add a default value, Category User and Configuration to Authenticated User. Then create the attribute and specify this default value as the Default Value. Susan Hi Susan, In a work item, I would like to add another Contributor attribute, which can be modified, but I would like to default value to start out being the "Created By" person. I know that "Created By" is generated by the system, is there a way to get that field on the initial creation only to get copied into this new field? |
Ralph Schoon (63.3k●3●36●46)
| answered Feb 04 '11, 2:54 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Susan,
the only solution for this I guess is mentioned in this article: http://jazz.net/library/article/537/. You could use a script based default value provider to achieve what you want. Please note that this is still experimental in 3.0. The article references more details in the Wiko here: https://jazz.net/wiki/bin/view/Main/AttributeValueProviders. The code would look somewhat like this:
Ralph In a work item, I would like to add another Contributor attribute, which can be modified, but I would like to default value to start out being the "Created By" person. I know that "Created By" is generated by the system, is there a way to get that field on the initial creation only to get copied into this new field? |
Ralph Schoon (63.3k●3●36●46)
| answered Feb 04 '11, 9:05 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Hi Susan,
great catch! It did not occur to me that the authenticated user would be the one you wanted. Thanks for figuring that out! Ralph I went back to the original first article, and looked again at the "Default Values" section, and there is a way to specify the "Authenticated User", which would be (on a create) the CreatedBy user. Once it is set, then the default value isn't needed, so that isn't a major problem and this SEEMS to do what I want (although I think I need to get "Unassigned" out of the list). |
How do I use the script? Is the script attached to the project area to test?
Hi Susan, |
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.