I want to automate my Jira with a custom plugin. This is what I’m trying to accomplish:
When a project is created, the project has the custom workflow (CustomWF) and all its components (post functions, conditions, etc…) automatically available.
Currently, I’m able to get the CustomWF from a .jwb file when exporting from an existing workflow in Jira. However, all custom plugin configurations on transitions are removed with the following message:
The items from the following plugins were removed from the workflow:
- explugin
Transition: Start Progress
Plugin post functions removed from this transition:
- Create Branch (explugin)
Transition: Done
System post functions removed from this transition:
- Update Issue Field
Transition: Done
Plugin post functions removed from this transition:
- Trigger Job (explugin)
System post functions removed from this transition:
- Update Issue Field
Transition: Reopen
System post functions removed from this transition:
- Update Issue Field
Transition: Reopen and start progress
System post functions removed from this transition:
- Update Issue Field
I was able to get the complete configuration (including all custom post functions) with a project XML export, however this only works for existing projects. All new projects built with CustomWF must manually set up these custom post functions for transitions.
How can I associate post functions with a project at creation time, if possible?
Thank you for your help! I’ve been combing through the forums with almost no luck :<
Em
It doesn’t cover nearly enough. The gist here is that you can also execute JAVA code in the Post-Creation Project Hook. That’s where you’d do additional input such as creating a new workflow and adding non-standard items to it.
Ah I see what you mean! I have a few post functions already created using the atlassian-create-jira-plugin-module command, I just need to add them to transition states (To Do > In Progress, for ex.) in a new workflow. I’ll go ahead and start looking into that. It’s possible to get the post functions I’ve created in that new workflow, right?
Sorry, was pulled away for another task for a bit. Thank you for your code snippet! I’m trying to see how to add my custom post functions but am not sure how to go about calling those classes. I followed the plugin tutorial for post-functions and have the following:
public class CreateRepo extends AbstractJiraFunctionProvider
public class CreateRepoFunctionFactory extends AbstractWorkflowPluginFactory implements WorkflowPluginFunctionFactory
I’m not sure how to add the postfunctions I made already to this code (in a different directory) I see that you used FunctionDescriptor. Would I have to do something like the following:
CreateRepo createRepoPostFunction = new CreateRepo(); /
FunctionDescriptor fd = ... ?
/* add post function to list of post functions of a certain action */
Thank you again! If you know of any good resources, please let me know. I’m a junior dev working on this project and no one else in my company knows Jira server development.
Did you make any progress? I am stuck in a similar situation to yours here in this thread. How do you create a FunctionDescriptor to add your already defined postfunction?