Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JogoShugh opened this issue Mar 7, 2017 · 0 comments
Open

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

JogoShugh opened this issue Mar 7, 2017 · 0 comments

Comments

@JogoShugh
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant