Use Post function to verify value of custom field

I am working on automatically configuring Support Request types of Issues to be automatically assigned to a user depending on the day of the week. 

I found a script for a scripted field value to convert the date into the day of the week. It is all very accurate, but. When I create the post functions on the workflow they dont seem to be working.

I also tried testing my condition via Script Runner so that it sends mail, and when I preview the condition is correct. And returns true / false perfectly. But when I create a support ticket in that task, no email is made. I aslo tried it with setting the Watcher. No luck as well.

What could be the problem?

These are the conditions I have tried:

 

  • cfValues['weekdayName'] == 'Thursday' (worked)
  • cfValues['weekdayName']*.value.contains('Thursday') (didnt work, returned false even though true)
  • issue.getCustomFieldValue('weekdayName') == 'Thursday' (didnt work, also tried cutsom field ID)
  • cfValues['weekdayName']?.getValue() == 'Thursday(didnt work)

Are the conditions different for scripted field values? What could I be missing?

Thank you in advance! 

1 answer

This widget could not be displayed.

Hi Michaella,

I would guess that the condition is not the problem, but rather that your post-functions are out of order. Whenever you add a post-function to your workflow step, make sure you move the post function to the very last step. The order should look like this:

Screen Shot 2017-08-31 at 12.51.39 PM.pngIf you've ensured it's on the right step and published your workflow, we might have to look at some other things if you're still having problems.

This condition should be the one you're using:

cfValues['weekdayName'] == 'Thursday'

 As there is no need to call .value() on a regular text field.

Yes that is the condition I used for the postfunction. And I transferred the added postfunctions below and it still wouldnt transition to another status so that it can assign :(

 

Note:

  • JIRA Version 6.1.4 
  • weekdayName is a Scripted Custom Field

Also, I apologize for the delayed response

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted Wednesday in New to Jira

Are you planning to trial, or are currently trialling Jira Software? - We want to talk to you!

Hello! I'm Rayen, a product manager at Atlassian. My team and I are working hard to improve the trial experience for Jira Software Cloud. We are interested in   talking to 20 people planning t...

148 views 2 0
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you