How can I run scripts as an ADMIN user instead of current user?
This concern is pretty important and typical when you are an admin and want to create and manage statistics from issues, eg: post functions that calculate values.
Since ScriptRunner has this option in every script, looks like SIL for Cloud always acts on behalf of the current user, so when the active user has no editing permissions the script will do nothing.
I think this could be enough reason to give up SIL and go for ScriptRunner since there is no way to work with permission schemes
As @Alexey Matveev mentioned in the comments, the only way to execute a Script as a specific user is through Listeners which it will take an enormous work on validation and verification of conditions
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm Sorry Alexey, but it's in Jira CLOUD and the checker gives me errors:
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.
That is right, This method is not available for Cloud. I asked cPrime about it. I will let you know when I get an answer.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can run a listener under a different user. If you could use your code in a listener, then you could run this script under an admin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is a huge drawback because it takes away the special thing i loved about SIL and power scripts which is the modularization and reusability of code ... with the suggested answer i would have to have a HUGE script verifying which kind of event ocurred (field changed, transition, etc.), check whether is the correct transition or not and then switch-case the piece of code i need to execute depending on the previous conditions.
I don't see this trully worths the effort right now, so i'll give up SIL and continue with ScriptRunner, maybe in the future i'll give the chance again to SIL when its development has been taken further.
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.