Creating follow up condition to create approval records
Hi,
I am trying to write a follow up condition to generate approval records on transition to a particular state. I got the new state and was able to compare it and now when i am trying to create approval records and trying to save WI using IWorkItemServer workItemServer= getService(IWorkItemServer.class); IStatus status =workItemServer.saveWorkItem2(workItem, null, null); I am getting staleDataException. Pls help me on this. Thanks |
2 answers
I had this problem too - originally I was using ISaveParameter.getNewState() method to retrieve the work item object. It turns out this gets the state of the object before it is persisted into the repository. Try something like this instead:
This gets you a fresh copy of the work item from the repository to work with. Hope this helps. Simon |
Thanks a lot.This is exactly what i was looking for.
I had this problem too - originally I was using ISaveParameter.getNewState() method to retrieve the work item object. It turns out this gets the state of the object before it is persisted into the repository. Try something like this instead: |
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.