Skip to content

Update partition-commits-for-instance-by-versionone-workitem #204

@JogoShugh

Description

@JogoShugh

Looks like one of the hotfixes did not get applied into the code.

We have this in production:

var getWorkitems = function(message) {
  var re = new RegExp("[A-Z,a-z]{1,2}-[0-9]+", "g");
  var matches = message.match(re);
  return matches;
}

var callback = function(state, ev) {
  if (ev && ev.eventType && ev.eventType[0] != '$' && ev.metadata && ev.metadata.instanceId 
      && ev.data && ev.data.commit && ev.data.commit.message) {
    var workItems = getWorkitems(ev.data.commit.message);
    var withOutDuplicates = workItems.filter(function (i, p) {
        return workItems.indexOf(i) == p;
    });
    withOutDuplicates.forEach(function(workItem) {
      workItem = workItem.toUpperCase();
      linkTo('versionOne_CommitsWithWorkitems-' + ev.metadata.instanceId + '_' + workItem, ev);
    });
  }
};

fromCategory('versionOne_CommitsWithWorkitemMention')
  .whenAny(callback);

But, it's different in the code. Need to review and resolve.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions