You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.
View groupJoin the community to find out what other Atlassian users are discussing, debating and creating.
I have a user defined function in a groovy script I keep in the Script Editor file list that I want to call from post function scripts also stored in the Script Editor list. My objective is to maintain one copy of the function that can be used across scripts (post functions). I have included the method's declaration to simplify the discussion.
def TransitionLinkedIssues(com.atlassian.jira.issue.Issue issue, String targetLinkTypeName, String targetCategoryName, String targetTransitionName) {
...
}
Hi @Jeff Abbott
You should create a folder in the jira directory: "Scripts" and store the scripts there.
Then in the groovy using the postfunctions or other you can call the function from using in the script.
import util. <your_groovy_name>
// and then call your function or method
<your_groovy_name> .functionName ()
I hope it helps you, you can find the documentation in Script Roots
Hi @Jeff Abbott
we store our util classes in Script Editor
Then access them from other other scripts
e.g. this is a workflow post function using the above
import com.cheil.retail.ShoptectConstants
import com.cheil.retail.ShoptectSubTaskHandler
import org.apache.log4j.Logger
def logit = Logger.getLogger("com.cheil.eu.logging")
ShoptectSubTaskHandler handler = new ShoptectSubTaskHandler(issue)
logit.info(handler)
handler.createSubTasks()
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.