Set assignment group for change task based on the variable field filled... Change Record producer
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 01:53 AM
How do we write a script in assignment rule. If a variable field "source_mssql_db_oracle_schema" contains SQL it should assign to AH_AHSAD_CHG_APP-DBA-SQL_L2 this group and if Oracle contains it should assign to AH_AHSAD_CHG_APP-DBA-ORA_L2 this group
Please correct me to achieve this requirement
(function() {
// Check if the field contains 'SQL'
if (current.source_mssql_db_oracle_schema.indexOf('SQL') !== -1) {
// Assign to the SQL group
current.assignment_group.setDisplayValue('AH_AHSAD_CHG_APP-DBA-SQL_L2');
}
// Check if the field contains 'Oracle'
else if (current.source_mssql_db_oracle_schema.indexOf('Oracle') !== -1) {
// Assign to the Oracle group
current.assignment_group.setDisplayValue('AH_AHSAD_CHG_APP-DBA-ORA_L2');
}
})();
Labels:
- Labels:
-
Change Management
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-17-2024 04:41 AM
Please try the following
(function() {
// Check if the field contains 'SQL'
if (current.variables.source_mssql_db_oracle_schema.indexOf('SQL') != -1) {
// Assign to the SQL group
current.assignment_group.setDisplayValue('AH_AHSAD_CHG_APP-DBA-SQL_L2');
}
// Check if the field contains 'Oracle'
else if (current.variables.source_mssql_db_oracle_schema.indexOf('Oracle') != -1) {
// Assign to the Oracle group
current.assignment_group.setDisplayValue('AH_AHSAD_CHG_APP-DBA-ORA_L2');
}
})();
Hope this helps.