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 ?
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.