You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I'm trying to write a custom ScriptListener to add users to a customer Organization in service desk whenever they log in from our LDAP directory.
I believe I need to teach the ScriptListener to listen for the UserAuthenticatedEvent. The challenge I have is how to reference the details of that event from within my script in order to get to the User and Directory objects for that event.
My initial thought was to reference the "event" variable, but that, alas, is of type IssueEvent, and not UserAuthenticatedEvent. The script editor complains if I try to ask it for the user or directory objects that would be in a UserAuthenticatedEvent object.
When I'm triggering a custom ScriptListener by something other than an IssueEvent, how do I get to the details of that event?
Well... It appears that the script editor doesn't know that the actual runtime environment can have different types of events.
If I ignore the errors in the editor and submit my code anyway, it is able to find the right methods of the UserAuthenticatedEvent when it executes.