Set work item resolution
I'm trying to modify the state and resolution of a work item using the 3.0 SDK.
Here's the relevant code: final IWorkItemWorkingCopyManager wiwcManager = wiClient.getWorkItemWorkingCopyManager (); Modifying the state by setting an action works okay but I'm running into problems with setting the resolution: Unexpected exception Any help or ideas would be appreciated. |
9 answers
Hi All,
I have a dataset which is join from three datasets. ie. A join from the first two dataset again joined with another. The result when viewed the Preview is fine. But when I upload it to the server or run the 'View Report' as an XLS or any other, I am not able to view the output of this join dataset. Is this a bug? I tried with different examples. Join of the first two dataset does not have this problem. But when it is joined with a third dataset, it is having this issue. Can somebody verify if this happens to them? Note: I am using RTC 2.0.0.2 Thanks Dhanya |
Hi All, All, Accidently posted as the reply. Sorry about this. |
Any ideas on this from the community?
I'm trying to modify the state and resolution of a work item using the 3.0 SDK. |
Bump.
Any ideas on this from the community? I'm trying to modify the state and resolution of a work item using the 3.0 SDK. |
It may seem silly, but you must specify whether a state has or not a resolution. What may be happening is that the state you are configuring has no resolution, so this property is immutable.
|
It may seem silly, but you must specify whether a state has or not a resolution. What may be happening is that the state you are configuring has no resolution, so this property is immutable. IWorkItem.setState2 is marked as deprecated, advising that WorkItemWorkingCopy.setWorkFlowAction should be used instead; that's what I'm using and that I know that the resolution I'm attempting to set is valid for the resolved state (in my test the work item is moving from open to resolved state via the "resolve" action). |
It may seem silly, but you must specify whether a state has or not a resolution. What may be happening is that the state you are configuring has no resolution, so this property is immutable. IWorkItem.setState2 is marked as deprecated, advising that WorkItemWorkingCopy.setWorkFlowAction should be used instead; that's what I'm using and that I know that the resolution I'm attempting to set is valid for the resolved state (in my test the work item is moving from open to resolved state via the "resolve" action). I'm just guessing here, but you could try to set the resolution (not saving) before calling the action and saving the WI, or you could save it without setting the resolution then reload it (get working copy again) and try to set the resolution. I don't work with client libraries, just server side. But in some cases I do (wrongly) use IWorkItem.setState2() because some states transitions shouldn't be visible to our users, so I can't set action. |
Your code looks correct to me: you are setting the workflow action and the resolution on a WorkItemWorkingCopy.
The ImmutablePropertyException shows that the workitem behind the WorkItemWorkingCopy is immutable (readonly). Could it be that you are trying to modify an immutable workitem? The reason why you are able to set the action but not the resolution is simple: the resolution is a real attribute of the work item whereas the workflow action is a transient attribute of the WorkItemWorkingCopy that is only used inside WorkItemWorkingCopy.save() to trigger the state transition. --andre Andre Weinand Work Item Team |
How does the GUI accomplish this task? I can modify the state & resolution of the same work item with the GUI.
Your code looks correct to me: you are setting the workflow action and the resolution on a WorkItemWorkingCopy. |
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.