Could someone please help me to do on the JIRA cloud using Behaviours or with any alternative way, how can I auto-fill the 'DataCenter Link' custom field value with the parent issue ID on the sub-task screen (where the issue type is 'Rack Subtask') like uploaded image but not after the sub-task is created?
Hi @Ramesh --
I second @Trudy Claspill 's question as to why you want to duplicate data that is already visible in every subtask (also, the subtask parent value is available in Automation, API calls, JQL, etc.)
But ALSO, I'm curious about this requirement of yours:
but not after the sub-task is created?
Because my first instinct was to suggest an Automation, which could absolutely do this after a subtask is created.
Is there some reason that users need to see this value when they're creating a subtask? Should they be able to override it? (That seems inadvisable if it is a subtask.)
If you can help clarify, that would improve our answers.
Thank you@Darryl lee for reply.
I am able to populate the Datacentre Link field in the created sub-task using an automation rule,
but the requirement is that this field must also be mandatory on the sub-task creation screen. So they are expecting to fill the custom field value with the parent issue id in the create sub task screen auto-fill is not working. Kindly help me to suggest is there any alternative way that I can achieve.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Ramesh
What have you tried so far?
I am curious about what problem you are trying to solve by adding the sub-task's parent issue ID to the Create Issue screen when the parent issue is visible in the background. Can you elaborate on that?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have tried below script through Behaviours in ScriptRunner In JIRA cloud
getting the parentIssue.id and parentIssue.key but parent issue ID is not adding in sub task screen of the "DataCenter Link" field value
import com.atlassian.jira.component.ComponentAccessordef
targetField = getFieldByName("DataCenter Link")
def parentIdStr = getFieldById("parentIssueId")?.value?.toString()if (!targetField || !parentIdStr) returndef issueManager = ComponentAccessor.issueManager
def parentIssue = issueManager.getIssueObject(parentIdStr.toLong())if (parentIssue) {
log.warn("Setting 'DataCenter Link' with issue ID: ${parentIssue.id}, key: ${parentIssue.key}")
targetField.setFormValue([
"key": parentIssue.key,
"id": parentIssue.id.toString()
])
targetField.setReadOnly(true)
}
Note: I am able to enter parent issue ID manually on "DataCenter Link" field textbox
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.