It's not the same without you
Join the community to find out what other Atlassian users are discussing, debating and creating.
Hello,
I am trying to develop a post function that should-
Pass the “Issue Key” to “getIssueByCurrentKey” method, once the issue has been created in JIRA for further actions.
or any other way to pass the issue key.
Please help!
Nishant
Hi,
For creation post-function try to use following:
import com.atlassian.jira.issue.MutableIssue; import com.atlassian.jira.workflow.function.issue.AbstractJiraFunctionProvider; import com.opensymphony.module.propertyset.PropertySet; import com.opensymphony.workflow.WorkflowException; import java.util.Map; public class ExamplePostFunction extends AbstractJiraFunctionProvider { @Override public void execute(Map map, Map map1, PropertySet propertySet) throws WorkflowException { MutableIssue issue = getIssue(map); //you can get issue key from here or String issueKey = (String) map.get("issue"); //return issueKey } }
in atlassian-plugin.xml write something like this:
<!-- PostFunctions --> <workflow-function key="example-function" name="Example Function" class="pathToYouFactoryClass.ExampleFunctionFactory"> <description>Example Function</description> <function-class>pathToYouClass.ExamplePostFunction</function-class> <orderable>true</orderable> <unique>false</unique> <deletable>true</deletable> <resource type="velocity" name="view" location="templates/function/functions-view.vm"/> <resource type="velocity" name="input-parameters" location="templates/function/functions-edit.vm"/> <resource type="velocity" name="edit-parameters" location="templates/function/functions-edit.vm"/> </workflow-function>
Example Factory class create like this:
public class ExampleFunctionFactory extends AbstractWorkflowPluginFactory implements WorkflowPluginFunctionFactory { ... }
In functions-edit.vm and function-view.vm you can write some text for example.
For more information please see tutorial.
This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.
Read moreHey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...
Connect with like-minded Atlassian users at free events near you!
Find a groupConnect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.
Start an AUGYou're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.