You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi friends!
I am trying to create a template in behaviour at same project Jira but only specifc component.
I create a server side script but its not work:
import com.atlassian.jira.bc.project.component.ProjectComponent
def desc = getFieldById("description")
def transition = getActionName()
def component = getFieldById(getFieldChanged())
List <ProjectComponent> comps = component.getValue() as List
if (transition.toString() == "Create"){
if (issueContext.issueType.name == "Task") {
if(!component.toString().contains("Gestão de Demandas")|| (!component.toString().contains("Gestão de Projetos"))){
def defaultValue = """
*[Objetivo]* - Qual a finalidade da minha demanda, por que tenho esse pedido?
*[Como]* - Descrever sugestão de solução para o problema
*[Dor]* - Descrever cada problema a ser resolvido
*[Benefício Esperado]* - Descrever o benefício esperado com este pedido
*[Quem solicitou]* - Foi você que pensou na demanda ou alguém que o solicitou?
""".replaceAll(/ /, '')
if (! underlyingIssue?.description) {
desc.setFormValue(defaultValue)
}
}
if (!component.toString().contains("Gestão de Demandas") || (!component.toString().contains("Gestão de Projetos"))){
def defaultValue = """
""".replaceAll(/ /, '')
if (! underlyingIssue?.description) {
desc.setFormValue(defaultValue)
}
}
}
}
if (transition.toString() == "Create"){
if (issueContext.issueType.name != "Task") {
def defaultValue = """
""".replaceAll(/ /, '')
}
}
if (transition.toString() == "Create"){
if (issueContext.issueType.name != "Task") {
def defaultValue = """
""".replaceAll(/ /, '')
}
}
Hello @Edimara ,
I have not tried exactly your script but it looks fine, have you checked the logs for any error ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.