Using ScriptRunner Fragments
Hey Atlassian Community! I am trying to only display a fragment when certain conditions are met.
What I need help finding is how to actually get the fragment to show when these conditions are met. Using the script console I can verify that the script is finding everything outlined here, but I can't find the syntax to say "ok now show the fragment".
OR if there is another way to access the type of a child issue that is more straightforward than this please let me know.
Any ideas?
Issues.search("issuekey in childIssuesOf('$issue.key')").each { child ->
def childKey = child.key
def childType = child.issueType
log.warn "$childKey, $childType"
if ( jiraHelper.project?.key == "PTDEMO" || jiraHelper.project?.key == "MSPG" && childType.name in "Project Resources" && issue.issueType.name == "Initiative" && issue.status.name !in ["Created","Roadmap Item Triage","Roadmap Backlog","Will Not Do","Ready for Design","Design","Ready for Delivery","Delivery","QA Validation","Pending Release","GA/Shipped","Bugtail"]){
//display the fragment...
}
}
I tried this and it isn't working. In the conditions section of fragments it says "Under what circumstances should this link be displayed. Must be either a plain script or an implementation of com.atlassian.plugin.web.Condition"
Am I trying to do something that is just out of scope of fragment conditions?
Issues.search("issuekey in childIssuesOf('$issue.key')").each { child ->
def childKey = child.key
def childType = child.issueType
log.warn "$childKey, $childType"
if ( jiraHelper.project?.key == "PTDEMO" || jiraHelper.project?.key == "MSPG" && childType.name in "Project Resources" && issue.issueType.name == "Initiative" && issue.status.name !in ["Created","Roadmap Item Triage","Roadmap Backlog","Will Not Do","Ready for Design","Design","Ready for Delivery","Delivery","QA Validation","Pending Release","GA/Shipped","Bugtail"]){
return true
}
}
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.