Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

ScriptRunner Behaviour - "loosing" behaviour when changing issuetype

Hi all,


I've an behaviour for creating issues which sets some field defaults, like project, linked issue, ...

Here a sample working script:

import com.atlassian.jira.component.ComponentAccessor

def issueManager = ComponentAccessor.getIssueManager()
def customFieldManager = ComponentAccessor.getCustomFieldManager()

def contextIssue = issueManager.getIssueObject(getContextIssueId())

getFieldById("issuelinks-linktype").setFormValue("relates to").setReadOnly(true)

getFieldById("summary").setFormValue("some default for description").setReadOnly(false)


We've a button (via script fragment) for creating the new issue from within another issue for a particular project, getting the project id with a serverside context-provider script .

Works, project is the right one, project field is readonly, issuelink fields are readonly and have the right values, creating the issue is possible and the fields are filled right in the new issue, but...

when changing the issuetype (in this "Create issue" screen) everything except summary get's lost - the project field is not readonly anymore (but it is still the right project), the issuelink-fields are not readonly any more, but the worst is the issuelink fields are empty.


Maybe a bug or am I using the behaviours in the wrong way? (scriptrunner version, JIRA server 7.1.10)



0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence

An update on Confluence Cloud customer feedback – June 2022

Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...

147 views 1 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you