How to add 'Unassigned' contributor to Value set?
Hello,
I am using Value set plugin to populate Contributor. Each time as per the selection of Team, I m populating members from that time. What I am expecting is to have 'Unassigned' contributor value in value set.
I have one more Value set plugin, which will populate Categories and for that I used below code to have 'Unassigned' category value.
ICategory unassignedCategory= workItemCommon.findUnassignedCategory(workItem.getProjectArea(),ICategory.FULL_PROFILE,monitor);
finalChoiceList.add(unassignedCategory);
So final list is having one 'Unassigned' category value. Same I want to have for Contributor. can anyone please suggest, how it can be achieved?
Thanks in advance.
I am using Value set plugin to populate Contributor. Each time as per the selection of Team, I m populating members from that time. What I am expecting is to have 'Unassigned' contributor value in value set.
I have one more Value set plugin, which will populate Categories and for that I used below code to have 'Unassigned' category value.
ICategory unassignedCategory= workItemCommon.findUnassignedCategory(workItem.getProjectArea(),ICategory.FULL_PROFILE,monitor);
finalChoiceList.add(unassignedCategory);
So final list is having one 'Unassigned' category value. Same I want to have for Contributor. can anyone please suggest, how it can be achieved?
Thanks in advance.
One answer
In https://rsjazz.wordpress.com/2015/10/16/due-date-notifier-an-asynchronous-task-example/ I used the ID of the contributor te retrieve the record. I haven't found a better way so far.
Comments
Hello Ralph,
Thanks for reply!!
I checked example. In this,
IContributor owner = (IContributor) getRepositoryService().fetchItem( ownerHandle, IRepositoryItemService.COMPLETE); if(owner.getUserId().equalsIgnoreCase(UNASSIGNED_USER_ID)){ // You might want to do something, e.g. annoy someone else. return; }</pre> <pre>
It looks like, we are checking, whether Owner field is 'Unassigned'. What I am trying to have is to add 'Unassigned' Value to populated list. So, this Value set plugin should return result as,
</pre> <pre>
Unassigned Ralph Avinash ABC . .
</pre> <pre>
I dont know how to fetch this Unassigned contributor and add it to list before returning value set. Kindly revert for any concerns. Thanks.
Search for the user ID "unassigned" or "Unassigned" I don't recall the actual value. That is what the code above does, it looks at the user ID and if that is "unassigned" it is the special unassigned user. You can get the user record for that ID and pass it.