Example: Validation based on the value of a date type project property
Actually I've a validation in a transaction based on a projectProperty. The validation is this:
%{11312} >= projectProperty("finifacturacion")
Where %{11312} is a selection date custom field and in the project I've defined the property: {finifacturacion=01/01/2015}.
I would like to use the value of this property in the validation message. How can I do that? I have tried the following string but it does not work:
No es posible modificar los datos de facturación. La fecha tope para hacerlo era el + projectProperty("finifacturacion").
I have included parser function stringToDate(string_date, timezone). This function returns the numeric value for string containing a date-time value for a certain timezone. To implement your validation you should use Boolean validator with math, date-time or text-string terms with the following configuration:
Boolean expression used is: {11500} >= stringToDate(projectProperty("finifacturacion"), LOCAL)
Note that:
- {11500} is code for numeric value of certain Date Picker or Date-Time Picker custom field. This field code depends on each particular Jira instance.
- In this example I have used timezone LOCAL, since I suppose that the literal date-time value in project property finifacturacion should be interpreted in Jira server's local timezone configuration.
- Valid string date-time formats for project properties are: yyyy/MM/dd HH:mm, yyyy-MM-dd HH:mm, yyyy/MM/dd and yyyy-MM-dd, also formats relative to current time like in JQL queries: "w" (weeks), "d" (days), "h" (hours) or "m" (minutes), or format defined at property system jira.date.time.picker.java.format. In your particular case, you should write your project property like this: {finifacturacion=2015/01/01}
Other examples of that function
- Block a transition until all sub-tasks have certains fields populated
- Block an epic's transition depending on linked issues status and due date
- Block or hide a transition for an issue depending on its issue links
- Block or unblock a transition after an issue rested a specific time in a status
- Block transition until all sub-tasks are in a specific status category
- Close parent issue when all sub-tasks are closed
- Enforce a field (Select List) to be set when another field (Radio Button) has a certain value (works with any kind of field type)
- Ensure that all issues linked with a certain issue link type have "Due Date" field set
- If field A is populated then, field B must also be populated
- Limit issue creation per role and issue type
- Limit the number of hours a user can log per day
- Limit valid dates for work logs
- Make "Time Spent" field required when there is no time logged in the issue
- Make a custom field mandatory when priority is "Critical" or "Blocker" and issue type is "Incident"
- Make attachment mandatory depending on the value of certain custom field
- Make different fields mandatory depending on the value of a Select List custom field
- Make linked issues, sub-tasks and JQL selected issues progress through its workflows
- Make parent issue progress through its workflow
- Prevent issue creation if another issue with same field value already exists
- Reject duplicated file names in attachments
- Require at least one sub-task in status "Resolved" or "Closed" when "Testing required" is selected in Check-Box custom field
- Require issue link when resolving as duplicate
- Restrict parent issue from closing if it has sub-tasks that were created during a given parent issue status
- Restrict sub-task type creation depending on parent issue status
- Restrict sub-task type creation depending on parent issue type
- Set a condition in a global transition which only applies in a certain status
- Validate a custom field "Story Points" has been given a value in Fibonacci sequence
- Validate compatible values selection among dependent custom fields
- Validate only issue links created in transition screen
- Validate that multi-user picker custom field A does not contain any user in multi-user picker custom field B
- Validation and condition based on time expressions
- Validation based on the value of a date type project property
- Validation on issue attachments
- Validation on MIME types of issue attachments
- Validation on sibling sub-tasks depending on issue type and status
- Validation on the value of a Cascading Select field