Post function structure is blank in the list of post functions added

I’ve created this postfunction:

  <workflow-function key="recalculate-deadlines" name="Recalculate deadlines" i18n-name-key="recalculate-deadlines.name" class="com.atlassian.jira.plugin.workflow.WorkflowNoInputPluginFactory">
    <description key="recalculate-deadlines.description">Plugin that recalculates deadlines of the following issues if any.</description>
    <function-class>com.azercell.jira.timetracking.postfunctions.RecalculateDeadlinesPostFunction</function-class>
  </workflow-function>

Created the corresponding class:

public class RecalculateDeadlinesPostFunction extends AbstractJiraFunctionProvider {
    public void execute(Map transientVars, Map args, PropertySet propertySet) throws WorkflowException {
        MutableIssue issue=getIssue(transientVars);
        System.out.println("Issue key Inside post function:"+issue.getKey());
    }
}

After installing the plugin, I am able to select the post function, add it to a transition and check if I get the output when transitioning to Done state. The output is as expected. However, in the list of post functions added, only the order number of my post function is visible. Like this:

Now, what is weirder is, if I disable the plugin, I get this:

As you can see, I get somewhat normal behavior only if I uninstall the plugin. And I say somewhat normal, because the Arguments section is showing full.module.key = com.azercell.DueDateUpdaterclose-parent-issue-post-function, which I can’t understand. Do you have any idea?

gonna say there’s something wrong with your view template.

Do I have to have a view template? I don’t need any visual stuff.

i don’t know if it’s a must but the page you’re having issues with is the only place the ‘view’ resource for a post function displays.

1 Like

Indeed, that was the view template issue. Adding the following line to the module and the corresponding view template solved the problem.

<resource type="velocity" name="view" location="templates/postfunctions/recalculate-issue-deadlines-post-function.vm"/>

2 Likes