How do I trigger a post function on null assignee condition

Marton Bodonyi April 11, 2016

I have a global transition that fires for every single create and makes the assignee of the task the same as the reporter.

post functions.png

 

It works perfectly however when I add the condition Assignee will have to be equal to NULL (empty value in the from) and user number or string or option value as the comparison it never fires.

conditions.png

 

The use case for this is when a task is created but doesn't have an assignee, automatically assign the reporter. This is a really really common use case for developers creating their own issues and the only solutions online seem to revolve around GROOVY script which is not something that we can run in the cloud version of JIRA.

 

Any tips about what's going wrong?

 

2 answers

1 vote
Elifcan Cakmak
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 11, 2016

hi,

it's because your condition and post function are completely independent from each other. you have to create a post function that says "if this then that" but you put "if" in one place, "then" in another.

this is not possible out of the box with JIRA but you can check MISC workflow extensions. I believe you can find a solution wtih this plugin.

https://marketplace.atlassian.com/plugins/com.innovalog.jmwe.jira-misc-workflow-extensions/cloud/overview

0 votes
Marton Bodonyi April 11, 2016

In the documentation there's a page on conditions https://confluence.atlassian.com/adminjiraserver070/advanced-workflow-configuration-749383189.html which states 

"

Conditions – check that a transition should be performed by the user.

"

The post function is a post function for this transition which contains the condition (they're all a part of the same transition). How can they be independent? If they are independent then what is conditions designed to actually do? I'm assuming that conditions is designed to decide whether or not the current transition runs or not (and it indeed seems to be preventing this transition from running when I have the condition set which would go against the idea that they are independent).

Elifcan Cakmak
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 11, 2016

condition means "if this is true for your issue then you can transition". like for example, with a condition you can check if all the subtasks are complete, then you can make the transition. or if this user has this permission then she/he can transition the issue. or if this user is in this group then she/he can transition the issue. etc.

but post function is what happens after you make the transition. for example after you transition the issue, the assignee is changed. or after you transition the issue a custom field is updated.

yes I can understand how you feel because they are all part of the same transition but they achieve different things. that's why you need to write a post function that says "if this happens then do this".

with your case I don't actually know what's going on so I can't say specifically why it doesnt work. but check out these solutions also:

https://answers.atlassian.com/questions/191975

https://answers.atlassian.com/questions/264544

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 12, 2016

To put it another way, a Condition and a Post-function are independent because they don't have anything to do with each other.  You can hang them on the same transition, but they don't interact.

A Condition happens before a transition, a post-function happens right at the end of it.

Suggest an answer

Log in or Sign up to answer