It's all about the answers!

Ask a question

Automatic Assignment of "approver" in Child Work item


Amit Girme (1132027) | asked Mar 16 '13, 3:37 a.m.
 Hi,

I have two work items with Parent - Child Relationship.

In Parent Work item i have created Two roles (for approval) of type contributor.

Now when Child work item goes at particular state, then the approvals should be added automatically. Approvers gets added automatically when the value of the roles are different in Parent Work item.

If value of the roles in parent Work item are same, then only single approver should get added in the child.
How is it possible to do with precondition?

I have tried doing it with precondition but it throws an exception saying 
 "An unhandled exception occurred: Approval descriptor already has an approval with the same approver"


Thanks in Advance.

Regards,
Amit

Accepted answer


permanent link
Ralph Schoon (63.5k33646) | answered Jan 04 '18, 5:20 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
Now when my Child Work item is in "In Progress" state it throws an exception as
"An unhandled exception occurred: Approval descriptor already has an approval with the same approver"

This exception indicates that you are trying to add the same approver a second time to an approval. You have to fix your code and check for approvers that are already added and only add the new ones.
Ralph Schoon selected this answer as the correct answer

3 other answers




permanent link
Amit Girme (1132027) | answered Mar 16 '13, 7:19 a.m.
 Hi Ralph,
I have gone through these links, i am able to add approvers automatically but for one scenario it throws and exception. 
Let me explain you in Detail:

Case 1
In Parent Work Item:

Reviewer1  : Amit
Reviewer2 :  Ralph 

In Child : 
At particular state say "In Progress" both the reviewers gets added automatically in approver section of my child work item

Case 2 :
In Parent Work Item

Reviewer1  : Amit
Reviewer2  : Amit

Now when my Child Work item is in "In Progress" state it throws an exception as
"An unhandled exception occurred: Approval descriptor already has an approval with the same approver"

How can i cater to this exception?

Regards,
Amit 

Comments
Ralph Schoon commented Mar 16 '13, 9:10 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

I would assume your participant triggers in the other state as well and tries to add the same approved again. I would debug if this is the case and potentially check if an approval and the approves is already there before trying to add it. 


permanent link
Matthew More (40313) | answered Jan 04 '18, 5:12 a.m.
edited Jan 04 '18, 5:19 a.m.

Amit,

I see you have some similar problem as me or you can help me.
I have few type of WI and on the end when user will choose some kind of one and after save some defined person will be added as approves, im not able to add this option i can add only subscribers automatically but have problem with approves  

Amit, Ralph
can you help me im really new in managing Jazz ?


Comments
Ralph Schoon commented Jan 04 '18, 5:17 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
  1. Stop adding answers to existing questions as new question, create your own question
  2. As answered in https://jazz.net/forum/questions/248331/how-do-i-automatically-add-approvals-to-newly-created-work-items and discussed here, you need a follow up action to do anything like this in linked work items. see the answer to your question https://jazz.net/forum/questions/248331/how-do-i-automatically-add-approvals-to-newly-created-work-items

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.