Workflow

Hi

How can I create workflow like this:

if (issue state = submitted) & (time tracking filled) then (change state to open)

if (issue save by developer) & (state not submitted) then (assign not empty)

 

Thanks,

0
3 comments

Hello,

What do you mean by "time tracking filled"? A specific work item or any work item or a work item added in this transaction?

What do you mean by "assign not empty"? 

You access fields like this: ctx.issue.fields.<fieldname>. Added work item can be found in ctx.issue.workItems.added.first(). 

0

Hi dear Ana

At least one time tracking stored.

assign value has not been empty.

0

Hi,

You can check that there is at least one work item by checking `ctx.issue.workItems.isNotEmpty()`. Issue state can be checked by comparing `ctx.issue.fields.State` to some hardcoded value and changed by assigning desired value to `ctx.issue.fields.State` (for example,`ctx.issue.fields.State = ctx.State.Open`, where ctx.State.Open is defined in requirements as shown here: https://www.jetbrains.com/help/youtrack/standalone/Workflow-Work-Timer.html#start-timer). 

You can clear Assignee field by performing ctx.issue.fields.Assignee = null. 

Hope it helps.

0

Please sign in to leave a comment.