It's all about the answers!

Ask a question

REST API For Approval State


Nate Decker (37814261) | asked Oct 04 '13, 8:16 a.m.
edited Jul 17 '14, 9:57 a.m.

I am trying to access information about an approval by leveraging the REST API. In particular, I am interested in finding out the state of a specific approval (not the aggregate value of a collection of approvals). I've been able to identify the REST command that will display the approvals with the names of the approvers associated with those approvals, but I have not identified the command to expose the state of the approval.

To find the name of the approver I am using:

Approvals/Approver/Name

According to this page https://jazz.net/wiki/bin/view/Main/ReportsRESTAPI, I should be able to drill down to find out information about an approval using these properties:

com.ibm.team.workitem.Approval

This element represents an approval from a single contributor with a particular state.

Properties:

  • stateIdentifier (type: xs:string). The state of the approval
  • stateDate (type: xs:time). The date the state was assigned
  • stateName (type: xs:string). The name of the state
  • approver (type: com.ibm.team.repository.Contributor). The contributor who is asked for approval
  • approvalDescriptor (type: com.ibm.team.workitem.ApprovalDescriptor). The approval descriptor that aggregates the approval

However, this does not appear to be correct. I can get the approver so that works, but "stateIdentifier" doesn't work (although, "stateId" does). The remaining properties don't appear to work either. It looks like what I really need is the "stateName" command.

Does anyone know what the correct syntax is for this?

Accepted answer


permanent link
Donald Nong (14.5k414) | answered Jul 17 '14, 8:48 p.m.
edited Jul 17 '14, 8:49 p.m.
Try this
https://<server>:9443/ccm/rpt/repository/workitem?fields=workitem/workItem[id=30]/approvals/(stateIdentifier|stateName|approver/name)

It works for me in my RTC 4.0.6 environment. The only filter in query is [id=30], and you can change it to fit.
Nate Decker selected this answer as the correct answer

Your answer


Register or to post 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.