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

How to start (script runner ) custom groovy script post function?

Hi all,

   I want start script runner - custom groovy script post functions, any one refer few links,

thanks.

 

7 answers

I didn't find the adapavist docs very helpful.

This guide did the trick for me:

http://igorpopov.io/2014/11/24/rocking-with-jira-script-runner/

Agreed. The Adaptavist docs need some T.L.C. 

Nic Brough Community Leader Sep 27, 2018

I keep asking them for a new version.  There's an overhaul of the UI for SR coming and hopefully we'll be getting better docs with it.

My instinct is the docs are accurate, but written by developers for developers.  Not for beginners or even intermediate level users.  The example the team can't argue is below:

I go to look for stuff on writing a scripted conditions and it starts with 'what a condition is'.  That's fine.  There's then a massive chunk of text all about caching and the internals of Jira.  That's dreadful, because 99.99% of the people landing on this page need "here's a simple condition" next, not an essay that's utterly irrelevant to what they're trying to do!

I think the utter disregard for useful documentation is what drives users to Power Scripts...it's that bad

1 vote
Nic Brough Community Leader Sep 30, 2015

I'm not sure what you mean by "start" in that question.

If you mean "start running a post function script", then you don't really.  You transition issues through the workflow so that the post functions are run by the system.  OR you can use the script console to run test scripts.

If you mean "get started with writing scripts for post functions", start at https://scriptrunner.adaptavist.com/latest/jira/quickstart.html - loads of background, recipes and example code there!

Hi Andrew Boutin,

Thanks for reply, As you maintained link(https://scriptrunner.adaptavist.com/latest/jira/custom-workflow-functions.html#_post_functions) is does't have any post functions, I have checked there.

Thanks.

 

0 votes
Nic Brough Community Leader Oct 01, 2015

That link goes to documentation on scripted post functions for me. What are you seeing?

Hey is there a sample script in built in for confluence script runner plugin so that I can start modifying it, for attachment scan while uploading and stop them from uploading with a message if it has sensitive data ?

Nic Brough Community Leader Nov 28, 2018

No, because that would be out of context and not make that much sense.

The way to detect this won't work for you either - you can detect "attachment added" but it's too late by then - the attachment will have been uploaded.  You could scan and delete it, but that will mess your users around.

Thank you soo much, is it possible, once the attachment is uploaded to scan and then drop a comment on that space saying it has sensitive data, i have a script that scans the attachments, looking for a way to run it in groovy and call that shell script once the attachment is uploaded then scan it, if it has sensitive data then comment on the space with a random message. Is there a groovy way or some other way to start with this? To scan the attachment once uploaded and then comment with message in regards to remove that attachment.? 

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Off-topic

Friday Fun: Virtual dance party!

Do dance parties help you relieve stress? How about *virtual dance parties*? My team holds virtual dance parties to brighten the mood of a tough day or celebrate an upcoming weekend.  Want t...

194 views 22 9
Join discussion

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