- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 10:38 AM
Hi,
The Initiate Deployment button is currently visible to Release coordinator, but now there is a condition needed where it should be also visible to Development Team (We have to get development team group name from Feature record). I have given a script under Initiate Deployment UI action but the issue is now its showing for all the users and the script is not checking for Development Team.
function isUserInFeatureDevelopmentTeam() {
var grFeature = new GlideRecord('rm_feature');
grFeature.addQuery('parent', current.sys_id);
grFeature.query();
while (grFeature.next()) {
var devTeam = grFeature.u_development_team;
if (devTeam) {
var grTeamMember = new GlideRecord('sys_user_grmember');
grTeamMember.addQuery('group', devTeam);
grTeamMember.addQuery('user', gs.getUserID());
grTeamMember.query();
if (grTeamMember.hasNext()) {
return true;
}
}
}
return false;
}
And in condition field of the UI action I have included the function name :
current.state == "25" &&
current.u_change_request.nil() &&
(current.assigned_to == gs.getUserID() || isUserInFeatureDevelopmentTeam());
What might be the issue here? Thanks in Advance
Solved! Go to Solution.
- Labels:
-
Release Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 11:14 AM
Hello @Nivedha G
It doesn't works like that. You cannot write function in script section and call it in condition because condition is evaluated first and it doesn't has access to function you have written. So it will get null.
Please wrap this function in a script include and call that script include in your UI script condition part.
&& ScriptIncludeName().METHODName()
Method in which you wrote this script then it will work.
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2025 03:25 AM
Hello @Nivedha G
current.state=="25"&¤t.u_change_request.nil()&¤t.assigned_to==gs.getUserID() && CheckDevelopmentTeamAccess().isUserInFeatureDevelopmentTeam(current.RELEASEFIELD)
Use above in the condition.
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-24-2025 10:51 AM
Hello @Nivedha G
Just to add to my previous reply, also share screenshots of your UI Action, full.
Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket.
Regards,
Shivalika
My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194
My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY