I want to let the Jira user know when the project is Temporary Restricted, on the issue screen, using custom field configuration. or do let me know if any other way is available.
Thanks in advance...
Groovy Script to get things done:
//scheme = 11400 Temporary Restricted
//scheme = 10200 (Permanent) Restricted
import com.atlassian.jira.component.ComponentAccessor
def projectManager = ComponentAccessor.getProjectManager()
def permissionSchemeManager = ComponentAccessor.getPermissionSchemeManager()
def targetProjectKey = issue.getProjectObject().getKey()
def project = projectManager.getProjectObjByKey(targetProjectKey)
def scheme = permissionSchemeManager.getSchemeIdFor(project)
if((scheme == 11400) || (scheme == 10200)){
"THE PROJECT IS <b style='color:red;'>RESTRICTED</b>"
} else {return "THE PROJECT IS <b style='color:blue;'>LIVE</b>"}
Hi @Kiran Chauhan , welcome on the community. You will have to user REST API endpoint: https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-project-permission-schemes/#api-rest-api-3-project-projectkeyorid-permissionscheme-get
But when the project is restricted, user can't access it. Where you want to display this information?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Martin Bayer _MoroSystems_ s_r_o__ I would like to do the same as kiran but would like to show the project Status (RESTRICTED OR LIVE) on Issue screen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Vruti Thakkar when user does not have Browse Project permission, he will only see error message when he access URL to this project
What exactly would you like to change?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Martin Bayer _MoroSystems_ s_r_o__ user have browse project permission, I wanted to add extra custom field(Scripted Field) which reflects the project permission Scheme Name on screen, and for that I might need to write groovy script which reflects permission scheme name, but I'm new to Groovy.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Vruti Thakkar you can use the mentioned REST API endpoint for getting information about associated permission scheme.
For implementation of scripted field you can use this documentation (https://scriptrunner-docs.connect.adaptavist.com/jiracloud/scripted-fields.html). There are also examples of code here:
Try to implement something and get back here for help with individual issues, please.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.