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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

getBehaviourContextId is null

When I attempt to replicate the behaviors script from this example, I can't seem to get a result from the getBehaviourContextId function.

/rest/com.onresolve.jira.plugin.Behaviours/1.0/behaviours/validators.json [com.acme.CreateSubtask] web item clicked:null

Here is the code I currently have:

import org.apache.log4j.Logger
import org.apache.log4j.Level
def log = Logger.getLogger("com.acme.CreateSubtask")

import com.atlassian.jira.component.ComponentAccessor

def issueManager = ComponentAccessor.getIssueManager()
log.debug "web item clicked:" + getBehaviourContextId()
if (getBehaviourContextId() == "cr-doc-bug") {

def contextIssue = issueManager.getIssueObject(getContextIssueId())

getFieldById("summary").setFormValue("Issue created from ${contextIssue.key}").setReadOnly(true)
getFieldById("issuelinks-linktype").setFormValue("relates to").setReadOnly(true)

I did map the behavior to the target project, I think:

behavior mapping.PNG

Any thoughts?

2 answers

We have the same exact problem. 

Have you been able to make a workaround?

We have also the same problem. I worked in jira 7.8, but it doesn't work in 7.11. Have you found a workaround?


Try to use 


in runInit() method

Suggest an answer

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

Upgrading your Confluence Cloud for Microsoft Teams app

If you were upgrading the legacy app to our new one, you might have run into the error below while trying to authenticate. We're still investigating the cause of this but here's a workaround...

20 views 0 0
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