Workflow trouble with a script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-23-2025 09:16 AM
I'm having some trouble with the following script in a workflow catalog task. The task default has a 3rd step in the description and short description.
The problem is the description and short description are being shortened even when employee type is "Regular". I added the log line just to be sure the employee type was being captured correctly and have confirmed that part. I also have this same script running in 2 sub PROD instances and it is working as expected in both of them. This is only an issue in the PROD instance.
Any idea what would be causing an issue only in 1 instance?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2025 12:59 PM
The if should only be updating the short description and description when current.variables.termination_user.u_employee_type != "Regular". But the issue is that even for users where u_employee_type == Regular the short description and description are being overwritten (2nd pic in my last reply) instead of staying on the default text from the TASK (1st pic in my last reply). What's really strange is that this TASK/script is working properly and not overwriting the text for u_employee_type == "Regular" in our 2 sub-PROD instances; the issue is only being seen in PROD. Since it is working in the 2 sub-PROD instances, I'm not confident that the script itself is the issue, but I also don't know where to start looking since the issue is only in one instance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2025 06:17 PM
Thanks for the clarification, so the IF statement is evaluated to TRUE even for those employees whose employee type is Regular.
If it's not working only in the PROD instance, maybe it's to do with the data.
Have you verified if the value of the 'Employee type' field is the correct for the corresponding record? Maybe there is a typo or it's 'regular' not 'Regular'?
Try running a background script to verify if the IF statement is being evaluated correctly.
Cheers