Selecting Random User From Certain Group for ATF Testing

jmiskey
Kilo Sage

I am creating an ATF Test to test an Incident from start to finish - from submission on our Service Portal to work completion/closure in ServiceNow.  I have the Service Portal submission piece working just fine, but have run into some issues trying to create the Steps/Actions in working/closing the Incident in ServiceNow.

Once an Incident of this type is created, it is assigned to our "Document Services" group.  So what I am trying to do is create a step to select a random user from the Document Services group, impersonate that user, and then set the "Assigned To" field on the Incident equal to this random user.

But I am having issues selecting this random user.  If I do a Record Query step on the sys_user table, the issue is that Groups are not part of this table.  So I tried doing a Record Query on the sys_user_grmember table, where the Group field was equal to "Document Services".  It did not seem to like that.  

Here are what my current steps look like.  It is choking on step 6:

find_real_file.png

The error message it is returning is:

FAILURE: No records matching query:
Group = Document Services

I do have active members in my Document Service group.

What am I doing wrong?  How can I accomplish my goal?

Thanks

1 ACCEPTED SOLUTION

Gerald Onyia
Kilo Guru

Hello,

 

Are you on ServiceNow New York? If you are, you can use the "Server -> Create New User" Step Configuration instead. In the Step Configuration, you can assign the user to the 'Document Services' Assignment Group.

If you're not on New York, your query should be to query a user from the sys_user table where 'Primary Assignment Group' is "Document Services".

 

Regards,

Gerald Onyia

View solution in original post

5 REPLIES 5

Gerald Onyia
Kilo Guru

Hello,

 

Are you on ServiceNow New York? If you are, you can use the "Server -> Create New User" Step Configuration instead. In the Step Configuration, you can assign the user to the 'Document Services' Assignment Group.

If you're not on New York, your query should be to query a user from the sys_user table where 'Primary Assignment Group' is "Document Services".

 

Regards,

Gerald Onyia

Of course!  So brilliantly simple!

Thank you so much!

Not a problem man! Happy to help!

Hi,

I don't see there is a field "Primary Assignment Group" in sys_user table.

So is thr other way to impersonate?

 

Thanks