Add subscriber in Work Item by programming
Hello,
How Can I add subscribers in a work item by programming? Thank you in advance. |
6 answers
You have two options:
- use the Java API, see: https://jazz.net:443/wiki/bin/view/Main/QueryDevGuide https://jazz.net:443/wiki/bin/view/Main/ProgrammaticWorkItemCreation - use the REST API, see: https://jazz.net/wiki/bin/view/Main/ResourceOrientedWorkItemAPIv2 (see section: Adding Links to a Work Item) hth, --Andre Weinand RTC Work Item Team On 2009-06-25 20:52:59 +0200, fco.moreno@gmail-dot-com.no-spam.invalid (fco.moreno) said: Hello, |
And the Java code is straightforward:
IContributor user=... some user; IWorkItem wi= ... some work item (may be from a WorkItemWorkingCopy); ISubscriptions subscription= wi.getSubscriptions(); subscription.add(user); --andre weinand RTC Work Item Team On 2009-06-25 20:52:59 +0200, fco.moreno@gmail-dot-com.no-spam.invalid (fco.moreno) said: Hello, |
Thank you very much!!
And the Java code is straightforward: Hello, |
Could you please provide me complete code ?
Thank you very much!! And the Java code is straightforward: Hello, w Can I add subscribers in a work item by programming? Thank you in advance. |
this code fail when I am trying to save the change by itemCopy.save
can you advice why? And the Java code is straightforward: Hello, |
This code now works fine with user login parameter (subscriber)
..... copyManager.connect(handle, IWorkItem.FULL_PROFILE, null); WorkItemWorkingCopy itemCopy = copyManager.getWorkingCopy(handle); IWorkItem item = itemCopy.getWorkItem(); IContributorManager contributorManager = teamRepository.contributorManager(); IContributor toadd = contributorManager.fetchContributorByUserId(subscriber, null); ISubscriptions subscription= item.getSubscriptions(); subscription.add(toadd); IDetailedStatus detailedStatus = itemCopy.save(null); System.out.println(detailedStatus.getDetails()); ..... this code fail when I am trying to save the change by itemCopy.save And the Java code is straightforward: Hello, |
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.