Forums

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

How to disable scriptrunner behaviours logging

Amir Ghaemian
October 10, 2018

Hi, In scriptrunner the behaviours flod the logs and I would like to disable the logging. I tried disabling from the behaviours UI config but it just re-enables all the time. 

Can I disable only the behaviour part of scriptrunner from the log4j settings? Or any other way I've might have missed? 

Cheers
Amir

2 answers

1 accepted

Suggest an answer

Log in or Sign up to answer
0 votes
Answer accepted
Alejandro Suárez García
Atlassian Partner
February 7, 2020

@Hi @Mike 

First of all, take care of the creation of users like that. If you use the password (wich is nullable) parameter in the method withUserDetails you wont let the user decide their passwords, and in my experience, they wont change their passwords at all.

If you don't care about it you should know that if you don't use 

createUserRequest.sendNotification(false)

they will receive an email notification in the creation.

With this said, lets go to the point, here you have the code to add the user to any group you want:

import com.atlassian.jira.bc.user.UserService
import com.atlassian.jira.component.ComponentAccessor

def user = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
def userService = ComponentAccessor.getComponent(UserService)
def groupManager = ComponentAccessor.getGroupManager()
def group = groupManager.getGroup("MyGroup")

UserService.CreateUserRequest createUserRequest = UserService.CreateUserRequest.
withUserDetails(user, "USERNAME", "ThisThis", "EMAIL ADDRESS", "First Last")
UserService.CreateUserValidationResult result = userService.validateCreateUser(createUserRequest)
if (result.isValid()) {
def newUser = userService.createUser(result)
groupManager.addUserToGroup(newUser, group)
} else {
result.getErrorCollection()
}
Mike
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 Champions.
February 8, 2020

Thank you

0 votes
Muhammad Akram Sharifi
Contributor
March 14, 2021

Can anyone help me with same issue on jira cloud? Thanks in advance 

TAGS
AUG Leaders

Atlassian Community Events