@@ -26,11 +26,35 @@ pipeline {
26
26
SYMFONY_PHPUNIT_DIR = " /opt/phpunit/"
27
27
SYMFONY_PHPUNIT_VERSION = " 9.5.3"
28
28
DOCKER_TAG = getDockerTag()
29
+ BRANCH_NAME = getBranchName()
29
30
BASE_BRANCH = getBaseBranch()
30
31
JIRA_TICKET = getJiraTicket()
31
32
}
32
33
33
34
stages {
35
+ stage(' Pull Request' ) {
36
+ agent any
37
+ when {
38
+ expression {
39
+ env. BRANCH_NAME . startsWith(" PROVIDER-" )
40
+ }
41
+ }
42
+ steps {
43
+ // Update Jira Ticket Custom fields
44
+ script {
45
+ // customfield_10126 - Merge Request
46
+ // customfield_10159 - Branch
47
+ def fields = [
48
+ fields : [
49
+ customfield_10126 : env. JOB_BASE_NAME ,
50
+ customfield_10159 : env. CHANGE_BRANCH ,
51
+ ]
52
+ ]
53
+ jiraEditIssue site : ' irontec.atlassian.net' , idOrKey : env. JIRA_TICKET , issue : fields
54
+ }
55
+ }
56
+ }
57
+
34
58
// --------------------------------------------------------------------
35
59
// Image stage
36
60
// --------------------------------------------------------------------
@@ -651,11 +675,6 @@ pipeline {
651
675
println " No functional reviewer assigned."
652
676
}
653
677
654
- // Link issue Pull Request field with current branch
655
- // customfield_10126 - Pull Request
656
- def fields = [fields : [customfield_10126 : env. JOB_BASE_NAME ]]
657
- jiraEditIssue site : ' irontec.atlassian.net' , idOrKey : env. JIRA_TICKET , issue : fields
658
-
659
678
// Validated - 10325
660
679
def status = issue. data. fields. status
661
680
println " Issue Status: ${ status.name} (${ status.id} )"
@@ -725,6 +744,10 @@ boolean hasCommitTag(String module) {
725
744
) == 0
726
745
}
727
746
747
+ void getBranchName () {
748
+ return env. CHANGE_BRANCH ?: env. GIT_BRANCH
749
+ }
750
+
728
751
void getBaseBranch () {
729
752
return env. CHANGE_TARGET ?: env. GIT_BRANCH
730
753
}
0 commit comments