Skip to content

Conversation

@ivanzolotuhin
Copy link

There is no git events related workflow example in the repo and luck of examples in public internet.
Used this article as starting point https://habr.com/ru/company/JetBrains/blog/512880/

Copy link

@oleg-larshin oleg-larshin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello,
It is possible to get newly added pull requests with the added collection:
ctx.issue.pullRequests.added
(see Set for more info)

Also, you can create a local variable and use the switch statement to make the code more compact:

var issue = ctx.issue;
var fs = issue.fields;
switch(issue.pullRequests.added.first().state.name) {
  case "OPEN":
    fs.State = ctx.State.Review;
    break;
  ...
}

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

Successfully merging this pull request may close these issues.

2 participants