Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

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
4,462,572
Community Members
 
Community Events
176
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("project-field").setReadOnly(true)
getFieldById("issuelinks-linktype").setFormValue("relates to").setReadOnly(true)
getFieldById("issuelinks-issues").setFormValue(contextIssue.key).setReadOnly(true)

getFieldById("issuetype-field").setReadOnly(false)
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 5.1.6.2, JIRA server 7.1.10)

 

Regards

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events