We can write a Groovy Post Function script to post a comment to an issue based on some triggering event but the owner of the comment is the currently logged in user.
Is it possible to post that comment as a Jira "system" user (for example, "administrator")?
Is that a lot of work to accomplish?
Yes you can. Change the dropdown so the script runs as the Scriptrunner Add-on user account
Thanks, @Randy .
Since I can't find a "Scriptrunner Add-on" account in the User Manager, do you happen to know what the name of the account is?
Is it always there even if I can't find it in User Manager?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Also, do you happen to have a snippet of code to change to that user account?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah i missed that you're on server. I believe you would use:
ComponentAccessor.getJiraAuthenticationContext().setLoggedInUser(user);
Pass the user you want to impersonate as the parameter of setLoggedInUser
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Just as a general rule you should avoid using an administrator account. Setup an account with specific rights/access for the tasks you need to run with it.
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.