Bulk upload of participant request stage validation
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-30-2024 08:31 AM
There are 4 stages namely Consultant , Solution , Plan , Execution. We have to allow bulk upload of participants through excel only for Execution Team and restrict for all other teams. How to acheive this through Buisness rule .
We wrote some lines in servicenow BR
var assignedTo;
var task_E = new GlideRecord('x_gmss_academyreq_skill_tracker_task');
task_E.addQuery('parent', current.getValue('request_id'));
task_E.query();
while (task_E.next()) {
if (task_E.stage == 'LD Execution Team') {
assignedTo = task_E.getValue('assigned_to');
}
}
if (assignedTo != gs.getUserID()) {
gs.addErrorMessage('Only the person who is assigned LD Execution Task for this request can perform bulk upload');
current.setAbortAction(true);
}
We tried with this script lines and it's Working for the scenario when it is in Execution Team the assigned to person and Excel uploading person should be same or else it should throw error message 'Only the person who is assigned LD Execution Task for this request can perform bulk upload.'
So now, it's not restricting when it moves to Plan team when we are uploading excel with any state change the state is getting changed and NO error message comes .. How to modify the exisiting code.
Kindly pour your suggestions.
0 REPLIES 0