Using Smart Values

Smart Values are computed expressions that calculate field values dynamically. They enable automation like date calculations, field references, and user data access.

Use Smart Values with the Set Field Value action to auto-populate fields with context-aware data.


What Are Smart Values?

Smart Values are expressions that evaluate to a value at runtime, rather than using static text or numbers.

Example comparison:

Static value:

Set Due Date = "2026-03-15"

Always sets March 15, 2026. Never changes.

Smart Value:

Set Due Date = addDays(today(), 7)

Calculates 7 days from today when the rule executes. Adapts to current date.


When to Use Smart Values

Calculate dates: Set due dates relative to today, calculate SLA deadlines, set dates to specific days

Reference fields: Copy values from one field to another, create dependent field relationships

Access user data: Auto-fill assignee or reporter fields with current user

Ensure consistency: Auto-fill fields with calculated values instead of manual entry


Date Functions

All date functions work in UTC to avoid timezone issues.

Current Date/Time Functions

now()

Returns: Current date and time in UTC

Example:

today()

Returns: Today's date at midnight UTC (00:00:00)

Example:

yesterday()

Returns: Yesterday's date at midnight UTC (00:00:00)

Example:

tomorrow()

Returns: Tomorrow's date at midnight UTC (00:00:00)

Example:


Date Navigation Functions

nextWeek()

Returns: Date 7 days from today at midnight UTC (00:00:00)

Example:

nextMonth()

Returns: Date one month from today at midnight UTC (00:00:00)

Example:

startOfWeek()

Returns: Start of current week (Monday) at midnight UTC (00:00:00)

Note: Week starts on Monday

Example:

endOfWeek()

Returns: End of current week (Sunday) at midnight UTC (00:00:00)

Note: Week ends on Sunday

Example:

endOfMonth()

Returns: Last day of current month at midnight UTC (00:00:00)

Example:

startOfDay(date)

Parameters:

  • date - A date value

Returns: Start of day (midnight UTC) for the given date

Example:


Date Arithmetic Functions

addDays(date, days)

Parameters:

  • date - A date value

  • days - Number of days to add (can be negative)

Returns: Date with specified number of days added

Example:

addWeeks(date, weeks)

Parameters:

  • date - A date value

  • weeks - Number of weeks to add (7 days each)

Returns: Date with specified number of weeks added

Example:

subtractBusinessDays(date, days)

Parameters:

  • date - A date value

  • days - Number of business days to subtract

Returns: Date with specified business days subtracted, skipping weekends (Saturday/Sunday)

Note: Business days are Monday-Friday

Example:


Date Methods

Date objects can have methods called on them using dot notation.

date.plusBusinessDays(days)

Parameters:

  • days - Number of business days to add

Returns: Date with specified business days added, skipping weekends (Saturday/Sunday)

Note: Business days are Monday-Friday. Called as a method on a Date object.

Example:


Field Functions

field(fieldId)

Parameters:

  • fieldId - Field ID or system name (e.g., "duedate", "summary", "customfield_10001")

Returns: Current value of the specified Jira field. Return type varies by field: string, number, Date, array, or undefined if field is empty.

Example:

Common field names:

  • duedate - Due Date

  • summary - Summary

  • description - Description

  • priority - Priority

  • assignee - Assignee

  • reporter - Reporter

  • customfield_XXXXX - Custom fields (use field ID)


User Functions

currentUser()

Returns: Current user executing the action, with accountId and displayName properties

Example:

Use case: Set Assignee or Reporter to current user


Practical Examples

Date Examples

Set due date to 7 days from now:

Set due date to next Friday:

Set review date to 3 business days from today:

Set start date to beginning of current week:

Set deadline to end of next month:

Field Reference Examples

Copy Due Date from another field:

Set Summary based on custom field:

User Examples

Set Assignee to current user:


Combining Smart Values

You can combine multiple functions to create complex calculations.

Due date 5 business days from now:

Start date at beginning of next week:

Date 3 days before a specific field's date:


Using Smart Values in Rules

Configuration Steps

  1. Create a rule with Set Field Value action

  2. Select the target field to populate

  3. Enter a Smart Value expression in the value field

  4. Save and test the rule

Example Rule

Requirement: Set Due Date to 3 business days from today when creating Bug issues

Configuration:

  • Screen: Global Issue Create

  • Target Field: Due Date

  • Scope: Bug issue type

  • Action: Set Field Value

  • Value: today().plusBusinessDays(3)

Result: When creating a Bug, Due Date auto-fills with today + 3 business days.


Best Practices

Use descriptive expressions: Choose functions that clearly express intent (e.g., today().plusBusinessDays(5) is clearer than complex date math)

Test with different dates: Verify Smart Values work correctly across month/year boundaries

Account for weekends: Use business day functions when working days matter

Validate field existence: Ensure referenced fields exist in the project before using field() function

Keep it simple: Break complex calculations into multiple rules rather than one complex expression


Error Handling

If a Smart Value fails:

  • The field will not be set

  • The rule will not prevent form submission

  • Check rule configuration for syntax errors

Common issues:

  • Referencing non-existent fields with field()

  • Invalid field IDs

  • Incorrect function names or parameters


Limitations

Time zones: All dates use UTC. Jira may display dates in user's local timezone.

Field types: field() returns different data types depending on the field. Ensure compatibility with target field.

No nested conditionals: Complex logic should be handled with multiple rules, not one Smart Value expression.


Next Steps

Learn about actions:

See examples:

Understand conditions:

Ready to create rules with Smart Values? Start with Creating Your First Rule.

Last updated