How to make visible 'Edit' Button in related list of Affected CI tab from 'Assess' to 'Review' state in change request

Venkat97
Kilo Expert

Hello,

'Edit' Button in related list of Affected CI tab from 'Assess' to 'Review' state in change request table should be visible only who having change manager role.

 

Thanks

 

 

1 ACCEPTED SOLUTION

Hello,

When you say: "But the concern is who having 'change_manager' role users also not able to see 'Edit' button under affected CI tab." That was not true with the last script I provided. The last script provided, change_manager role users COULD see the Edit button, but it was only for the Assess state.

Anyways, with this new script, change_manager role users CAN see the Edit button within a Change Request for Change Requests with a state of: Assess, Authorize, Scheduled, and Implement (so up to and not including Review). So all during Assess they'll see Edit, all during Authorize they'll see Edit, all during Scheduled they'll see Edit, and all during Implement they'll see Edit. Once it gets to Reviewed, they'll not see Edit anymore.

if ((parent.state == -4 || parent.state == -3 || parent.state == -2 || parent.state == -1) && parent.active == true && gs.hasRole('change_manager')) {
    answer = false;
} else {
    answer = true;
}

find_real_file.png

find_real_file.png

find_real_file.png

find_real_file.png

find_real_file.png

 Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

View solution in original post

5 REPLIES 5

Allen Andreas
Administrator
Administrator

Hello,

How are you? Have you attempted to look in to this yourself?

What have you found or not found thus far?

Would love to hear a bit more, like, what's your thoughts on where to start, where have you looked already, etc?

To get you started, you can do something like this:

Navigate to your change request form, scroll to Affected CIs related list, right-click any column header and choose Configure > List Control:

find_real_file.png

Then add the "Omit edit condition" field to the form because by default I don't think it's there:

find_real_file.png

Then add the Omit edit condition filed to the form. Once that's done you can use script like this:

if (parent.state == -4 && parent.active == true && gs.hasRole('change_manager')) {
    answer = false;
} else {
    answer = true;
}

find_real_file.png

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hello @Allen A 

 

Thanks for the response.  I have added script in "Omit edit condition" field as you suggested. After applied the code, Non-change manager users are not able to see 'Edit' button in Affected CI tab of change form. It working as expected.

 

But the concern is who having 'change_manager' role users also not able to see 'Edit' button under affected CI tab.

 

My requirement is Change manager users should ability to see 'Edit' button under affected CI tab for change records having state from Assess to Review.

 

Non-Change managers should not ability to see 'Edit' button under affected CI tab for change records having state from Assess to Review.

 

Appreciate for you help

 

Hello,

When you say: "But the concern is who having 'change_manager' role users also not able to see 'Edit' button under affected CI tab." That was not true with the last script I provided. The last script provided, change_manager role users COULD see the Edit button, but it was only for the Assess state.

Anyways, with this new script, change_manager role users CAN see the Edit button within a Change Request for Change Requests with a state of: Assess, Authorize, Scheduled, and Implement (so up to and not including Review). So all during Assess they'll see Edit, all during Authorize they'll see Edit, all during Scheduled they'll see Edit, and all during Implement they'll see Edit. Once it gets to Reviewed, they'll not see Edit anymore.

if ((parent.state == -4 || parent.state == -3 || parent.state == -2 || parent.state == -1) && parent.active == true && gs.hasRole('change_manager')) {
    answer = false;
} else {
    answer = true;
}

find_real_file.png

find_real_file.png

find_real_file.png

find_real_file.png

find_real_file.png

 Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Venkat97
Kilo Expert

Your provided script was helpful. I have modified code as per my requirement.

 

Thanks


if ((parent.state == -3 || parent.state == -2 || parent.state == -1 || parent.state == 0) && parent.active == true && !gs.hasRole('change_manager')) {
answer = true;
} else {
answer = false;
}