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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Build own Built-In Script Fields with Scriptrunner Edited

Hello,

I am currently trying to write a Script for Scriptrunner that can be used by our regular administrators to create Scripted Custom Fields similar to the Built-In Script Fields.

 

I already found out the following:

The package needs to be com.onresolve.scriptrunner.canned.jira.workflow or com.onresolve.scriptrunner.canned.jira.fields (or similar???)

The script file has to be located under <script root>/<package>/<script>.groovy

The class needs to implement at least the CannedScript interface

By following these 3 requirements, I already managed to get an element into the Built-In scripts general menu, but NOT in the Script Fields menu. This especially means I was not able to create a Script Field through this form.

 

What I cannot find out at all:

How can I make the script be categorized in the correct category in the ScriptRunner/Admin/Browse/Script Fields panel? 

How can I make my Script Field behave like the built-in script fields, e.g. creating a field when submitting the form?

 

I have pasted my source code to this link: https://pastebin.com/kJyP2hdn

 

I would appreciate any help. It would be great if someone could provide a sample for a built-in script field. I could not find one, and Adaptavist support could only provide a sample listener unfortunately.

 

1 answer

Hi Chris, 

We are posting this here so others can benefit from the response we gave in your support ticket

We unfortunately do not make our source code public.

As explained in our docs, you can either add plain scripts or “built-in scripts” which can be parameterised. Such scripts must implement the com.onresolve.scriptrunner.canned.CannedScript interface, and must be added to specific packages in order to show up in the correct place in the UI. To add scripts to the Built-in Scripts menu, add them to the com.onresolve.scriptrunner.canned.common.admin menu.

See the sample plugin source code for further examples.
https://bitbucket.org/Adaptavist/scriptrunner-samples/src/master/jira/src/main/groovy/com/onresolve/scriptrunner/canned/jira/workflow/SampleScriptListener.groovy

Kind regards,

Katy

Adaptavist Product Support 

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Marketplace Apps & Integrations

Learn how to request and manage app requests in the Marketplace

G’day everyone! Super exciting news coming from the Marketplace. We have now fully rolled out the ability for end-users to submit app requests to admins directly from within the product! No longer ...

62 views 1 7
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