The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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")
log.setLevel(Level.DEBUG)
import com.atlassian.jira.component.ComponentAccessor
def issueManager = ComponentAccessor.getIssueManager()
log.debug "web item clicked:" + getBehaviourContextId()
if (getBehaviourContextId() == "cr-doc-bug") {
getFieldById("project-field").setReadOnly(true)
getFieldById("issuetype-field").setReadOnly(true)
def contextIssue = issueManager.getIssueObject(getContextIssueId())
getFieldById("summary").setFormValue("Issue created from ${contextIssue.key}").setReadOnly(true)
getFieldById("issuelinks-linktype").setFormValue("relates to").setReadOnly(true)
getFieldById("issuelinks-issues").setFormValue(contextIssue.key).setReadOnly(true)
}
I did map the behavior to the target project, I think:
Any thoughts?
Hi!
Try to use
getBehaviourContextId()
in runInit() method
We have the same exact problem.
Have you been able to make a workaround?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello everyone, Hope everyone is safe! A few months ago we posted an article sharing all the new articles and documentation that we, the AMER Jira Service Management team created. As mentioned ...
Connect with like-minded Atlassian users at free events near you!
Find an eventConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.
Host an eventYou're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.