Record Producer script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2012 04:52 AM
Hi there
I have a record producer form as one of our service catalogue items. I need to get some of the populated variable information into the title or short description. Does anybody know how to do this?
Regards
Luke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2012 01:27 PM
To access variables used in record producer I use syntax current.variables.[variable name] from a business rule. I think the same will work in "run script" activity in workflow which you can use to create new cmdb record using GlideRecord object. Then you might want to save the ci sys_id to scratchpad to use it in "create task" activity scripts to populate new change task Configuration Item field.
Example or "Run Script" Activity in workflow (I did NOT test it)
rec = new GlideRecord("cmdb_ci_server");
rec.initialize();
rec.name=current.variables.server_name;
workflow.scratchpad.ciSysid = rec.insert();
In later activities you will be able to reference to ci sys_id using
task.cmdb_ci = workflow.scratchpad.ciSysid;
More about ScratchPad: http://wiki.servicenow.com/index.php?title=Using_the_Workflow_Scratchpad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-26-2013 06:09 AM
current.short_description = producer.var1 + ' '+producer.var2; // 🙂