0

I'm trying to resolve issue by action in workflow But it returns error

exports.rule = entities.Issue.onChange({
  title: "Resolver",
  guard: function(ctx) {
    return ctx.issue.isReported;
  },
  action: function(ctx) {
  workflow.resolve(ctx.issue);
  },
  requirements: {
  }
});

Thanks for advice

frankegoesdown
  • 1,898
  • 1
  • 20
  • 38

1 Answers1

2

You just need to change the state of issue.

exports.rule = entities.Issue.onChange({
  title: "Resolver",
  guard: function(ctx) {
    return ctx.issue.isReported && ctx.issue.isReported;
  },
  action: function(ctx) {
    ctx.issue.fields.State = 'Resolved';
  },
  requirements: {
    State: {
       name: 'State',
       type: entities.EnumField.fieldType
    }
  }
});
num8er
  • 18,604
  • 3
  • 43
  • 57