How to set Contributor type field to Unassigned in Attribute Customization script?
We're trying to create a customized attribute script in Javascript where when a work item goes to a specific State, a custom field of type=Contributor will be automatically set to Unassigned.
I've done this before with UIDs for specific Team Members who should be the default value, but how would we represent Unassigned in the script rather than a specific user?
I've done this before with UIDs for specific Team Members who should be the default value, but how would we represent Unassigned in the script rather than a specific user?
Accepted answer
I would output the value of the literal Unassigned from the specific contributor attribute to a log or console or just another string field, then use that value to be returned from the script.
for example, when I set Owner attribute to Unassigned and run
var ownername = workItem.getValue(WorkItemAttributes.OWNER);
return ownername;
and capture the return on a string attribute, I get
_YNh4MOlsEdq4xpiOKg5hvA
as a value.
Now, from my script, I return this value and any Contributor attribute associated with this script gets set to Unassigned.
for example, when I set Owner attribute to Unassigned and run
var ownername = workItem.getValue(WorkItemAttributes.OWNER);
return ownername;
and capture the return on a string attribute, I get
_YNh4MOlsEdq4xpiOKg5hvA
as a value.
Now, from my script, I return this value and any Contributor attribute associated with this script gets set to Unassigned.
Comments
Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Oct 16 '12, 12:51 a.m.Michael Walker
Oct 19 '12, 3:06 a.m.Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Oct 19 '12, 3:27 a.m.Michael Walker
Oct 19 '12, 3:59 a.m.Ralph Schoon
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER Oct 19 '12, 4:06 a.m.