action: function()

in js/streamlining-issue-reporting/set-template-based-on-type.js [10:29]


  action: function(ctx) {
    var issue = ctx.issue;

    var typeIs = function(value) {
      return issue.fields.Type.name === value.name;
    };

    if (typeIs(ctx.Type.Bug)) {
      issue.description =
        'What steps will reproduce the problem?' +
        '\n1.\n2.\n3.\n\n' +
        'What is the expected result?\n\n' +
        'What happens instead?\n';
    } else if (typeIs(ctx.Type.Feature)) {
      issue.description =
        'What should be implemented?\n\n' +
        'Why is this functionality required?\n';
      issue.fields.FixVersions.add(ctx.FixVersions.Backlog);
    }
  },