Is that possible to change planned start date and planned end date in the change request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2022 07:48 AM
Hi ,
We have a requirement that in the change request Planned start date and Planned end date field to be not greyed during the entire life cycle for users under assignment group -
Is that possible , please help me on this below request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2022 12:37 AM
In the change form we have department field , in the department field we have three department , based on the department user select the Assignement Group is changing ,
we have 4 Departments - associated with groups ,
but in my requirement , For XYZ group , planned start and end date should be editable ,
Note - The XYZ Group is not Associated with the departments.
image is business rule written in the change request table ,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-31-2022 12:52 AM - edited 10-31-2022 12:57 AM
For this write a Display Business rule with condition and script as shown below :
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var assignedTo = current.getDisplayValue("assignment_group");
g_scratchpad.isGroupMember = gs.getUser().isMemberOf(assignedTo); //Checks if the logged in user is member of the assignment group and sends the result to client side
})(current, previous);
2. Write a client script as shown below:
Script:
function onLoad() {
//Type appropriate comment here, and begin script below
var chgState = g_form.getValue("state"); // Assuming scheduled and implement is -1 and -1
if (chgState == '-2' || chgState == '-1') {
if (!g_scratchpad.isGroupMember) {
g_form.setDisabled("start_date", true);
g_form.setDisabled("end_date", true);
}
}
}
NOTE : Don't forget to deactivate the UI Policy written before to make both field readonly.
I Hope this helps.
Please mark this helpful if this helps and Accept the solution if this solves your issue.
Regards,
Kamlesh