Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

To pull information from approval tab using javascript

 Hi,


We have a process of applying two types of approvals, code and test approval
My requirement is to find whether the approver of code and test are not the same.Is there a way to pull information from the approvals tab using Javascript ? 
Else, how can this be done easily ?

0 votes



3 answers

Permanent link
Hi Pavithra,
                     You can create a Client plugin and run a workitem query to retrieve the item ids first and then retrieve the approver values for each of the individual approval items.

Useful methods for this:

ISaveParameter param = (ISaveParameter) data;          
IAuditable auditable = param.getNewState();                   
                if (auditable instanceof IWorkItem) {                  
                IWorkItem sourceworkItem = (IWorkItem) auditable;               
IApprovals approvals= sourceworkItem.getApprovals();
approval.getApprover()

Thanks.

1 vote

Comments

Cool...Will try it and let you know how it works...


Permanent link
Hi Pavithra,
                    I am not sure if this can be done using the javascript. But you can do it using Java API. Should be possible using Rest service as well.

Is this required to be run on all existing items (or) for new items?

Thanks.

0 votes

Comments

Thanks for the reply, Valli

Not on all resolved workitems , but alteast for all the unresolved ones...


Permanent link

You can get the approver using the REST API. If you have an existing REST query for a set of work items, ensure that the end of the query URL includes the following display attributes:

|approvals/approver/name

0 votes

Your answer

Register or log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details

Question asked: Aug 07 '12, 5:31 a.m.

Question was seen: 4,599 times

Last updated: Jun 20 '13, 2:34 p.m.

Confirmation Cancel Confirm