Hi there,
I've just downloaded Scriptrunner to Jira cloud and want to add a post function script so that when I create a new issue, it automatically inherits the value entered in the associated epic.
From what I've read in the Community, it looks like I need to add a script to a workflow transition.
I'm struggling to understand which workflow needs editing. Are there specific workflows for issue creation that I need to configure?
I've never used Scriptrunner before, so am on a big learning curve...!
Thanks
Hi Barry,
Thank you for your question.
I can that in order to add a post function you should navigate to the project settings for the project which you wish to add the post function to which is located at the URL of <JiraBaseUrl>/secure/project/EditProject!default.jspa?pid=IdOfProjectHere.
Once on the project settings page, you should find the workflow that you want to edit and open it to edit in diagram mode and edit the transition where you wish to add the post function too.
You will then need to select the ScriptRunner Post-Function radio button and then the Run Script option on the screen that is displayed. This will then bring up a screen where you can enter the code for your post function.
I can confirm that you can find more details of how to edit workflows inside of the Atlassian documentation pages located here.
I can also to confirm that to get started you can see lots of examples inside of the documentation pages located here and here as well as by clicking any of the links next to the Example text under any code box such as on the Script Console page.
If this response has answered your question can you please mark it as accepted so that other users can see it is correct when searching for similar answers.
Regards,
Kristian
Hi Kristian,
out of curiosity - is this also possible for next-gen projects?
Cheers,
Matthias.
PS: You should change your name from rounded brackets to square brackets - otherwise it is not possible to mention you.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Matthias,
Thank you for your response.
I can confirm that currently only standard Jira projects support Jira post functions and that next gen prokects do not support these at this time.
Regards,
Kristian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kristian,
Thanks for the very clear and detailed reply. I'll look to follow the steps and examples you mention and report back with progress.
Thanks again
Barry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you are right that you have to add a script to a workflow transition.
Since you're on Jira Cloud, the first step is to determine what type of project you are using. Jira Cloud differentiates between Next-Gen and classical projects. You can do so by checking out the bottom of your project settings:
Classic project
If you're using a classic project, you can click on workflows in this menu and see what workflow is used for your project. Then you can edit that workflow and add your post function to the create transition:
I hope this helps get you started. Let us know if you need more help.
Next-gen project
I think it is not supported for next-gen projects, but maybe someone else knows more.
Cheers,
Matthias.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Matthias thanks very much for the prompt reply.
I can confirm we are using Classic software projects. I've found the Create transition and will look to add the post function.
Cheers
Barry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.