Skip to content

Commit 62cbc72

Browse files
added a simple regex to find jira issue in field by a given regex (#714)
1 parent 1e9e7f3 commit 62cbc72

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

incubating/jira-issue-manager/script/jira_issue_manager.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,11 @@ def environment_setup():
6666
# Logic here to use the regex to grab the jira issue key and assign it to issue
6767
jira_issue_source_field = StepUtility.getEnvironmentVariable('JIRA_ISSUE_SOURCE_FIELD', env)
6868
jira_issue_source_field_regex = StepUtility.getEnvironmentVariable('JIRA_ISSUE_SOURCE_FIELD_REGEX', env)
69-
## TODO - Brandon - need to do regex work here
70-
issue = jira_issue_source_field
69+
70+
if jira_issue_source_field_regex:
71+
issue = re.match(jira_issue_source_field_regex, jira_issue_source_field).group(0)
72+
else:
73+
issue = jira_issue_source_field
7174

7275
# Issue fields below
7376
# Retrieve the project environment variable and add the project to a dict representation

incubating/jira-issue-manager/step.yaml

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ kind: step-type
22
version: '1.0'
33
metadata:
44
name: jira-issue-manager
5-
version: 1.0.11
5+
version: 1.0.12
66
title: Jira Issue Manager
77
isPublic: true
88
description: Create, Update, & Validate Jira Issues
@@ -12,6 +12,7 @@ metadata:
1212
stage: incubating
1313
maintainers:
1414
- name: Brandon Phillips
15+
- name: Dustin Van Buskirk
1516
categories:
1617
- build
1718
official: true
@@ -245,7 +246,7 @@ spec:
245246
stepsTemplate: |-
246247
main:
247248
name: jira-issue-manager
248-
image: quay.io/codefreshplugins/jira-issue-manager:1.0.11
249+
image: quay.io/codefreshplugins/jira-issue-manager:1.0.12
249250
environment:
250251
[[ range $key, $val := .Arguments ]]
251252
- '[[ $key ]]=[[ $val ]]'

0 commit comments

Comments
 (0)