Issue Lifecycle Properties and Methods
Issue Life Cycle
Issue Life Cycle related methods consist of two parts: the first one relates to the statuses of issue from the moment of a draft creation to the moment of an issue deletion (isReported()
and becomesReported()
), while the second one refers to the resolveness of an issue (isResolved()
, becomesResolved()
, becomesUnresolved()
).
From Creation to Deletion
All the workflow rules that are not connected with schedule (that is: All but schedule rules and 'in ...' blocks in state machines) are processed at the end of a transaction.
A transaction is a set of current changes, which are saved in database or aborted together. When you start editing an issue you actually start a new transaction. This transaction will be closed (flushed) when you click the Submit button to apply all changes you've made. This single transaction includes all the changes you've made on this issue.
Issue life cycle consists of several stages:
- Issue is created in this transaction: In this case the issue is called draft and has no issue ID. The default custom field values are set on this step.
- Issue is draft: This stage covers all the issue changes after creation and before reporting (the issue is draft when you edit it and it doesn't have an issue id yet).
- Issue becomes reported in this transaction: The issue becomes reported (e.g. the "Create issue" button is clicked and the issue is submitted) and gets an issue id.)
- Issue is reported: This stage covers all the issue changes between its reporting and deletion.
- Issue is deleted in this transaction: The issue is deleted and will not be available after this transaction is closed.
Respectively, YouTrack provides several issue methods for checking the life cycle stage:
Method | Description |
---|---|
isReported(): Boolean
|
True if the issue is at stage 3 or 4, False otherwise.
|
becomesReported(): Boolean
|
True if the issue is at stage 3, False otherwise.
|
Resolved and Unresolved Issue Status
Along with the "draft" and "reported" status, an issue can also be resolved or unresolved. When issue is resolved it means that it has one of the resolved States (Fixed
, Verified
etc.)
Entering a resolved state automatically sets issue.resolved
date to that moment, and returning to an unresolved state sets issue.resolved
to null
.
There are also the similar corresponding methods: