Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Run scriptrunner as Admin

Till Horstkamp October 29, 2021

Hey, 

i have a groovy script that needs to read Information of an object out of Insight, but the User who is excicuting the Postfunktion dose not have access to our Insight. 

Is there a way to get around that, and execute the script as admin? 

 

def insightCF = issue.getCustomFieldValue(com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObject(10300))[0

 

def w_intervall ="0";

try {

w_intervall = objectFacade.loadObjectAttributeBean(insightCF.getId(), 60).getObjectAttributeValueBeans()[0].getValue().toString();

w_intervall = w_intervall.substring(0,2)

        } catch (Exception e) {

            w_intervall = "12"

        }

 

So the script always runs into the exception if a user with out permission to read Insight runs the transition.

Greeting Till

 

1 answer

1 vote
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 29, 2021

If they don't have permission to see the objects in Insight, then they shouldn't be running something that could expose it to view.

Why not just grant them view rights, as they need to see the data in there?

Suggest an answer

Log in or Sign up to answer