Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

gs.getSession().isInteractive() not working properly

RohanBathla
Tera Contributor

Hi I am using below code in one of my BR to check the update condition on task. below is the code which I am using but when I put logs i see that if condition was not matched.

 

!current.cat_item.u_partner_correlation_id.nil() && gs.getSession().isInteractive()&& current.cat_item.u_partner_name =='XYZ'

 

I am suspecting it might be due to gs.getSession().isInteractive(). Can you help me with correcting the condition ?

 

Thanks

Rohan

1 ACCEPTED SOLUTION

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

You can just log all three in the script part of the BR and remove it from condition to test.

-Anurag

-Anurag

View solution in original post

9 REPLIES 9

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

as per your BR condition it would only run for interactive sessions and not when something gets inserted/updated from API

are you testing from API or from UI?

Did you check by removing one by one which condition is failing

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

we are testing from the UI and I just tested removing the entire condition and BR RAN on update but I will try removing one by one and I can check which one is failing.

Hi,

Sure keep posted.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

 

Thanks for your suggestion actually the issue was with current.cat_item condition BR is on sc_task so this had to be dot walked.

 

Regards,

Rohan

Nice to hear.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader