- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-12-2021 10:49 AM
Hi Community,
My catalog item contains MRVS which contains reference (application to select), select box & text variables. How do we copy these values selected onto the catalog task description?
Tricky part is, Each row with different reference variable selected will create a catalog task per row . There can be multiple tasks generated. And that catalog task description should contain only that row variable values.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2021 02:27 PM
A script like this should get you close.
var mrvs = current.variables.mrvs_internal_name;//replace with the internal name of your MRVS
var rowCount = mrvs.getRowCount();
for(var i = 0; i < rowCount; i++){
var row = mrvs.getRow(i);
var app = new GlideRecord('cmdb_ci_business_app');//replace with the reference table name of your MRVS application reference variable
app.addQuery('sys_id', row.v_mrvs_application);//replace with the name of your MRVS aplication reference variable
app.query();
if(app.next()){
if(app.assignment_group == task.assignment_group){
task.description = 'some text ' + row.v_variable1_name + ' some more text ' + row.v_variable2_name;
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2021 02:27 PM
A script like this should get you close.
var mrvs = current.variables.mrvs_internal_name;//replace with the internal name of your MRVS
var rowCount = mrvs.getRowCount();
for(var i = 0; i < rowCount; i++){
var row = mrvs.getRow(i);
var app = new GlideRecord('cmdb_ci_business_app');//replace with the reference table name of your MRVS application reference variable
app.addQuery('sys_id', row.v_mrvs_application);//replace with the name of your MRVS aplication reference variable
app.query();
if(app.next()){
if(app.assignment_group == task.assignment_group){
task.description = 'some text ' + row.v_variable1_name + ' some more text ' + row.v_variable2_name;
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2021 02:16 PM
Hi Brad,
Forgot to mark your answer as correct as it was helpful for me to get the mrvs values that belongs to each catalog task.
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2021 03:21 PM
You are welcome!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-04-2021 04:35 PM
Hi Brad,
I have got an issue with the code in the business rule to obtain phone number from a text field containing other characters, I have posted the below question on community for the same.
https://community.servicenow.com/community?id=community_question&sys_id=e8f773381b33a4107a5933f2cd4bcb8b
Could you please let me know how to get such phone number / email from the text field and append the domain name and send email (this I have done with event and added domain name to the field value in business rule).