Hi all,
I want to preload a template for my users to follow when creating certain issues. We use an issue type for users to reach out to management for publishing access, and ideally, we'd like to provide a template for them to fill out whenever they select the component "Open Source" and set/select the label "Publish_Blog".
This is what I have so far set as the initialiser for publish access issue types in our project:
import com.atlassian.jira.component.ComponentAccessor
import static com.atlassian.jira.issue.IssueFieldConstants.COMPONENTS
import static com.atlassian.jira.issue.IssueFieldConstants.LABELS
def desc = getFieldById("description")
def summary = getFieldById("summary")
def projectComponentManager = ComponentAccessor.getProjectComponentManager()
def components = projectComponentManager.findAllForProject(issueContext.projectObject.id)
def defaultValue = """1. Where can we find the text you wish to publish? Provide a Google Doc or repo link. See examples at _______.com
2. What meta tags should be added to the post?
3. Who is the author and owning team? Who should this post be attributed to?
4. What is the business value to Avg Jo's for publishing this post?
5. Does your manager and project architect that this should be published, including review for confidential internal information?
6. What is the name of your L2 for approval? Please add to Reviewer field.
7. Should this be distributed on Avg Jo's social channels?
8. Did someone from your group's comms team review and edit the content?
9. Is there an embargo date (don't publish before) or deadline (must publish by)? Please set Due Date to desired publish date""".replaceAll(/ /, '')
def defaultValue2 = """Request to publish public engineering blog post for <project or team name>???""".replaceAll(/ /, '')
if ((getFieldById(LABELS)) == "Publish_Blog" && getFieldById(COMPONENTS) == "Open Source" && getActionName() in ["Create Issue", "Create"]) {
desc.setFormValue(defaultValue)
summary.setFormValue(defaultValue2)
}
This unfortunately doesn’t work because when I navigate to the Create Issue form and set the component and label fields as defined, summary and description are still null.
Any help would be highly appreciated .