Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the releaseDate function for a specific day of week

Ron L
Contributor
August 14, 2017

Hello, I'd like to use the JQL function releaseDate to target a specific day in the week, for example Tuesday of the current week without having to specify a specific day.  This is used to dynamically populate a dashboard that shows all the issues scheduled for release on each day of the current week.

Basically, I want to write the equivalent of:

fixVersion in releaseDate("after startOfWeek('+1d') before startOfWeek('+2d')")

 

1 answer

1 accepted

Suggest an answer

Log in or Sign up to answer
1 vote
Answer accepted
PD Sheehan
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 Champions.
March 18, 2021

Hi there

Taking you at your word that you want field C to be required when a.1 is selected and at the same time b.3 is selected, you could try a script like this:

def fieldA = getFieldByName('A - Test') //this is the label for the field A
def fieldB = getFieldByName('B - Test 1')
def fieldC = getFieldByName('C - Test 2')

def fieldAValuesThatTriggerFieldCRequired = ['a.1. E'] //this has to be the label of the option
def fieldBValuesThatTriggerFieldCRequired = [ 'b.3. L'] //you could add additionoal values here in coma separated list
def valueA = fieldA.value
def valueB = fieldB.value

def fieldCIsRequired = valueA in fieldAValuesThatTriggerFieldCRequired && valueB in fieldBValuesThatTriggerFieldCRequired
fieldC.setRequired(fieldCIsRequired)

You would put this code in the behaviours section of script runner. Create a new configuration that maps to your project. Then edit the behaviour configuration and add field A and Field b.

For each of those 2 fields, add a server-side script and put the script above in each of those server-side scripts. These server-side scripts run each time values change in each of those fields so that the fieldC can be re-evaluated each time.

To make fieds A and B required, you can do it with the behaviour toggles on each field. Or you can make this globally required in your project's field configurations.

TAGS
AUG Leaders

Atlassian Community Events