Additional Condition on Approval User Activity

saikatmitra
Tera Contributor

Hi Team,

My requirement is to add another condition like 'Approved' and 'Rejected', called 'More Information Required' in the Approval Group Activity,

 

so I have created the condition 'More Information Required' in the workflow activity

and added the same in Choices of State field on Approval(sys_approval_approver) table.

 

And in the condition field added : activity.result =='more_info_required'

 

Now, when I select approve or reject the workflow goes to the next activity but not when I select More Information Required in the

approval table record, it gets stuck in the same activity and doesn't proceed.

 

find_real_file.png

 

I am sure I am missing something, I don't know how does the activity.result gets set to the state(like in case of approve and reject)

 

Can someone please help me on this.

 

 

Thanks in advance

 

16 REPLIES 16

Hi Dirk,

No, I have not implemented any BR. I have just added another state value which is "more_info_required" and then used the code in my Workflow activity. id here stands for the ids present where approval is triggered for this Approval Group activity. Now if the count of any id clicking state value as "more_info_required" is 1, then automatically the group.more_info_required  will be set to 1 and  the answer will be set as "more_info_required" and accordingly steps will be taken up in my subsequent workflow activity.

This piece of code handles the above mentioned scenario,

 

for (var id in groups) {
var group = groups[id];
if (group.more_info_required == 1){
gs.log("answer is :"+answer);
answer = 'more_info_required';
gs.log("answer is set :"+answer);
}

saikatmitra
Tera Contributor

There is one more issue happening here which I have just observed now. I am not sure if this is because of this activity.

The problem is now after the approval group is triggered and approved, the Approval User field remains blank in Group Approval Related List in Service Now. I want the user approved to be populated under the  Approval User field  for the ISRC group. Please help with your advise. The screenshot is given below.

 

find_real_file.png

 

HI

How did you set up your approval group WF Activity?

Do ALL members of the group need to approve, or is it enough, that only ONE Approver approves.

If you need the approval by ALL members, maybe thats the reason, why that field is not populated. Because it is not only ONE concrete person that may be mentioned there.

Let me know if that finally answered your question so that you can close this thread by marking my answer as correct and helpful.

BR

Dirk

No, it is configured to be approved by any one approver from the group only and which did but still approval user is empty.

The workflow is designed condition based on script for Group activity.