---
schema: rendered-html/v1
title: "Update Fields on Issue Update | Developer Portal for YouTrack and Hub Documentation"
source_url: https://www.jetbrains.com/help/youtrack/devportal/update-fields-on-issue-update.html
generated_at: 2026-06-11T15:14:31.615888+00:00
---

Feedback

Thanks for your feedback!

Was this page helpful?

YesNo

Developer Portal for YouTrack and Hub

- Developer Portal
- Apps
- MCP Tools
- YouTrack Workflows
- JavaScript Workflow Quick Start Guide
- Create a Workflow
- Edit a Workflow
- Workflow Rule Types
- Transactions
- Use Cases for Workflows
- Restrict Issue Visibility with Workflows
- Prevent Unwanted Updates
- Prevent Issue Deletion with Workflows
- Streamline Issue Reporting
- Automate Work Handoffs
- Generate Issues Automatically
- [Update Fields on Issue Update](update-fields-on-issue-update.html)
- Propagate Values Between Issues
- Track Spent Time
- Generate Time Reports
- Enhance Helpdesk Support
- Send Internal Newsletters
- Deactivate Voting for Issues
- Web-based Workflow Editor
- Using an External Code Editor
- Default Workflows
- Custom Workflow Repository
- JavaScript Workflow Reference
- YouTrack Import Scripts
- YouTrack Form API
- YouTrack REST API
- Hub REST API

1. YouTrack Workflows
2. Use Cases for Workflows
3. [Update Fields on Issue Update](#0)

# Update Fields on Issue Update﻿

Last modified: 07 May 2026

One of the most useful applications for workflows is to automate issue updates. The purpose of this automation is to make YouTrack do the dirty work for you. The workflows for the use cases on this page show you how you can update issues based on changes that are applied to the issue itself.

## Apply Changes in Response to Manual Updates﻿

You may have never realized that part of the functionality that you use on a daily basis in YouTrack is implemented with workflows. One such workflow is Subsystem Assignee, which is attached automatically to new projects.

This workflow contains one rule – `Set subsystem owner as assignee for unassigned issues` – which does exactly what the title says. The concept is relatively straightforward. Many organizational processes imply that each subsystem in your product has a responsible person or "owner". This person is the default Assignee for each new issue that is assigned to this Subsystem. When you designate an owner for each of your subsystems, every new issue is assigned accordingly. Here's the corresponding workflow rule:

```
const entities = require('@jetbrains/youtrack-scripting-api/entities');
const workflow = require('@jetbrains/youtrack-scripting-api/workflow');

exports.rule = entities.Issue.onChange({
  title: 'Set subsystem owner as assignee for unassigned issues',
  guard: (ctx) => {
    return !ctx.issue.fields.Assignee && ctx.issue.fields.Subsystem;
  },
  action: (ctx) => {
    const issue = ctx.issue;
    if ((issue.isReported && (issue.fields.isChanged(ctx.Subsystem) ||
        issue.isChanged('project'))) || issue.becomesReported) {
      issue.fields.Assignee = issue.fields.Subsystem.owner;
    }
  },
  requirements: {
    Assignee: {
      type: entities.User.fieldType
    },
    Subsystem: {
      type: entities.OwnedField.fieldType
    }
  }
});
t
```

> ### note
>
> Workflow Localization
>
> Default workflows in YouTrack use the `workflow.i18n(...)` method to localize workflow messages. This is an internal function that is only meant to be used to reference localized message strings. To ensure that you can copy and customize this workflow code, we have removed this function from the sample. When you write your own workflows, you always know the language of your YouTrack installation, so you don’t need to use this method.
>
> If you want to edit the messages in default workflows, remove this method and replace its usage with a plain string of message text. For details, see Workflow Localization.

This type of update is useful in a wide range of cases. Here are just a few examples:

- Set the current user as Assignee when the issue state changes from Open to In Progress.
- Change the issue State from Wait for reply to Open when a new comment is added.
- Mark an issue as Fixed when the Fix versions are set.
- Clear the Fix versions field when the issue state changes to Duplicate or Incomplete.

## Apply Changes on a Set Schedule﻿

Let’s say that you want to improve your productivity and support the [Pomodoro technique](https://www.pomodorotechnique.com/) in your project. There are plenty of ways to do it: set up a physical timer, use a mobile app, enable a browser extension... or you can simply enable the Pomodoro Timer workflow, which is distributed with YouTrack.

This workflow is supported by a set of additional custom fields, including Pomodoro state and Pomodoro countdown. As soon as the Pomodoro state changes to Timer's running, the Pomodoro countdown is set to 25. A scheduled rule immediately starts decreasing the value in the countdown field by 1 every minute:

```
const entities = require('@jetbrains/youtrack-scripting-api/entities');
const workflow = require('@jetbrains/youtrack-scripting-api/workflow');

exports.rule = entities.Issue.onSchedule({
  title: 'Enable Pomodoro countdown',
  search: 'has: {Pomodoro countdown} AND Pomodoro countdown: -0 AND (Pomodoro state: {Timer’s running} OR Pomodoro state: {On a break})',
  cron: '0 * * * * ?',
  action: (ctx) => {
    const issueFields = ctx.issue.fields;
    issueFields['Pomodoro countdown'] -= 1;
  },
  requirements: {
    'PomodoroCountdown': {
      name: 'Pomodoro countdown',
      type: entities.Field.integerType
    },
    'PomodoroState': {
      name: 'Pomodoro state',
      type: entities.EnumField.fieldType
    }
  }
});
```

- [Update Fields on Issue Update](/help/youtrack/devportal/update-fields-on-issue-update.html)
- [Apply Changes in Response to Manual Updates](/help/youtrack/devportal/update-fields-on-issue-update.html#apply-changes-in-response-to-manual-updates)
- [Apply Changes on a Set Schedule](/help/youtrack/devportal/update-fields-on-issue-update.html#apply-changes-on-schedule)

Generate Issues AutomaticallyPropagate Values Between Issues

- Privacy & Security
- Terms Of Use
- Trademarks
- Legal

Copyright © 2000–2026 JetBrains s.r.o.

![](https://bat.bing.com/action/0?ti=5220035&tm=gtm002&Ver=2&mid=3d97c6e1-705d-43fc-a230-f0af4f446baf&bo=4&sid=452929b065a111f19a7fe7356f74a419&vid=aa3122f0648711f1a10d6d095e10fd87&vids=0&msclkid=N&pi=918639831&lg=en-US&sw=1920&sh=1080&sc=24&tl=Update%20Fields%20on%20Issue%20Update%20%7C%20Developer%20Portal%20for%20YouTrack%20and%20Hub%20Documentation&p=https%3A%2F%2Fwww.jetbrains.com%2Fhelp%2Fyoutrack%2Fdevportal%2Fupdate-fields-on-issue-update.html&r=&lt=653&pt=1781190868944,51,51,,,2,2,2,2,2,,3,27,28,55,252,252,252,653,653,653&pn=0,0&evt=pageLoad&sv=2&asc=G&cdb=AQAS&rn=220939)

![](https://crawler.prototype.prolicht.digital/l/Ong1Zg)![](https://crawler.prototype.prolicht.digital/l/3hlO7V)
