Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×I have a groovy script in Post Function for one of workflows in ServiceDesk. It creates objects in Assets. I found out that these assets are created by the user that performs transition.
Is it possible to perform this task as another user? We have a special service account in ServiceDesk called Automate.
I create assets using code like this:
def objectTypeRecord = objectTypeFacade.loadObjectTypeBean(8);
/* Create a new unsaved object bean */
def objectBean = objectTypeRecord.createMutableObjectBean();
/* Set up the attribute list */
def attrBeans = new ArrayList();
// .....
objectBean.setObjectAttributeBeans(attrBeans);
objectBean = objectFacade.storeObjectBean(objectBean);
As an alternative I can use REST API and provide a token of Automate account, but it would be nice to stay inside groovy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.