State-Machine Workflow Issue in Sprint Mode

Hi, I created a state machine for my project to control the transition of states. If I open the issue and try to change the state from there, I get the message that I wanted to display and the state remains in "Open", however, when I try to change the state from the sprint view, the task is moved to the new state and I get the message displaying I can't move it to there, and only when I refresh does it return back to Open. To note that when I moved the ticket in sprint view, when I refresh the task itself the state is still Open (and hasn't changed).

Please let me know if any more info is needed.

Any help would be appreciated.

5 comments
Comment actions Permalink

Hi,

Please attach a screenshot of the message you see when trying to change the state and share the full code of your state machine rule. 

0
Comment actions Permalink

Hi Anastasia,

The message I am getting is one that I defined in the workflow You do not have permission to move the task to "In Progress".

The code of the workflow is the below:

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

exports.rule = entities.Issue.stateMachine({
title: 'Status state-machine',

fieldName: 'State',

states: {
Open: {
initial: true,
transitions: {
InProgress: {
guard: function(ctx) {
if(!ctx.currentUser.isInGroup('cbkdev')) {
workflow.message('You do not have permission to move the task to "In Progress"');
return false;
}

return true;
},
targetState: 'In Progress'
}
}
},
'In Progress': {
transitions: {
open: {
targetState: 'Open'
},
ToVerify: {
guard: function(ctx) {
if(!ctx.currentUser.isInGroup('cbkmobile')) {
workflow.message('You do not have permission to move the task to "To Verify"');
return false;
}

return true;
},
targetState: 'To Verify'
}
}
},
'To Verify': {
transitions: {
InProgress: {
targetState: 'In Progress'
},
Done: {
targetState: 'Done'
}
}
},
Done: {
transitions: {}
}
},

requirements: {}
});
0
Comment actions Permalink

Hi,

I am sorry for the delay. Could you please attach a screen recording illustrating the problem?

Also, do you use standalone (which build number?) or inCloud (what is your instance name then?) YouTrack? 

0
Comment actions Permalink

Hi Anastasia,

This is the link for the recording https://ufile.io/y8m99.

We are using the standalone version with build number 43142.

0
Comment actions Permalink

Hi,

I am very sorry for the delay. It looks like a bug, could you please record a HAR-file (firefox is more preferable; https://youtrack-support.jetbrains.com/hc/en-us/articles/206546369-When-we-ask-you-to-provide-additional-details-logs-database-HAR-etc-) on moving the card on the sprint view and attach it to a support request (please create it here: https://youtrack-support.jetbrains.com/hc/en-us/requests/new?ticket_form_id=66282) so we could investigate?

0

Please sign in to leave a comment.