Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×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.
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.