Lifecycle activity with in the activity set triggered if the Subject Person is Manager

Simran321
Tera Expert

Hi There,

 

I have an activity with in the activity set that needs to be triggered if the Subject Person is manager. Is it possible to achieve this?

 

Any help is appreciated.

 

 

3 REPLIES 3

Community Alums
Not applicable

Hi @Simran321 ,

If this activity in ask is part of a activity set, then it will anyways will get triggered along with other activities part of the activity set.

You cannot have different trigger conditions within the activity set for different activities.

 

David Aldridge
Giga Guru

Hi @Simran321 ,

 

Are you saying that the activity will trigger if the Subject Person is a manager (has direct reports)?

 

If you have a group that contains all managers or a role specific to managers, you could set up user criteria based on this and create an Audience for managers. There is an OOTB (may be demo data) User Criteria for Manager that contains the following script:

var gr = new GlideRecord('sys_user');
gr.addActiveQuery();
gr.addQuery('manager', user_id);
gr.setLimit(1);
gr.query();
gr.hasNext();
 
If you have this, you can create an audience record using this criteria.
 
There is also an OOTB audience for users with the role sn_mh.manager_hub_user which might work for you.
 
Hope this helps
 
David.

I agree with your thought here! My only comment would be, I would suggest to use "GlideAggregate" (https://developer.servicenow.com/blog.do?p=/post/glideaggregate/) instead to get familiar with functions that are meant to "count" - but I do know that GlideRecord is not "wrong" here, but I would argue that GlideAggregate is more accurate here.