Hi!
We need a Behaviours JavaSctript script, which hides one of the organisations of ServiceManagement, so the members don't receive mails, when one of them create a ticket.
But I can't get the value of the organisations field to compare it.
If the organization is the 158, it should disappear
getFieldById("customfield_10002").setVisible(false); // organization field
It doesn't work... Please could you help me community?
Filally I put a script in the transition of the WF ServiceManagement that it put the participants and I forget the organization.
If the community need this script is there:
def issueKey= "XXX-111"
def issue
def result = get('/rest/api/2/issue/' + issueKey)
.header('Content-Type', 'application/json')
.asObject(Map)
if (result.status == 200){
issue = result.body
} else {
return "Failed to find issue: Status: ${result.status} ${result.body}"
}
def array = [
"accountIds1",
"accountIds2",
"accountIds3"
]
def accountIds = []
// Construir un array de objetos con el formato esperado
array.each { accountId ->
accountIds << [accountId: accountId]
}
def update = put("/rest/api/2/issue/${issueKey}")
.queryString("overrideScreenSecurity", Boolean.TRUE)
.header('Content-Type', 'application/json')
.body([
fields: [
customfield_10119: accountIds
]
] )
.asString()
if (update.status != 204) {
return "${update.status}: ${update.body}"
}
return 'Success'
Hi Eduard,
Behaviours can only manipulate the front-end of the system, it does not allow you to stop sending mail to someone based on what is entered on the screen.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes I know that, but, in this case what we do is that all the users are part of a specific organisation 158, and what we want is that the user cannot share the issue with anyone if it is not of the type 10463.
I don't know if I'm making myself clear, because when sharing it, it sends mails.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline 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.