hii ,
can anyone please help me with this ,
i want to set default value for Epic Link . Thanks in advance
Hi @sgole
You can try to apply the sample script below in the Behaviour Initialiser:
import com.atlassian.jira.component.ComponentAccessor
// Get Epic Link field and it's value
def epic = getFieldByName("Epic Link")
def value = epic.getValue() as String
if(getActionName() == "Create" && value == null ){
//Set epic link
epic.setFormValue("RAIN-12")
}
I'm using Scriptrunner 6.18.0 and Jira 8.13.1.
Hope you found this useful!
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.
Hi @sgole ,
It's similar to the sample script above. Try to get your sprint by its Id, then set it with sprint id.
//Get Sprint field by its id
def sprint = getFieldById("customfield_10101")
//Set the default sprint with sprint id
sprint.setFormValue(1)
You can refer to the community post here on getting the sprint id.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @sgole ,
I found this resolved Atlassian Community discussion to be relevant to this case: Create a default Epic Link using Behavior . Do check it out if it suits your requirement.
I hope this helps.
Kind regards,
Irfan
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.
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.