Codefresh Steps: Reusable Code for Common Operations
This page provides code you can use to perform common operations in the Codefresh CI/CD platform.
Jira Issue Manager jira-issue-manager
Create, Update, & Validate Jira Issues
arguments
JiraCommentCreate:
title: Add Jira Comment
type: jira-issue-manager
arguments:
JIRA_BASE_URL: 'https://company-name.atlassian.net/'
JIRA_USERNAME: '${{JIRA_USERNAME}}'
JIRA_API_KEY: '${{JIRA_API_KEY}}'
JIRA_ISSUE_SOURCE_FIELD: '${{JIRA_ISSUE_SOURCE_FIELD}}'
ACTION: comment_create
COMMENT_BODY: Test from codefresh pipeline
JiraCommentUpdate:
title: Update Jira Comment
type: jira-issue-manager
arguments:
JIRA_BASE_URL: 'https://company-name.atlassian.net/'
JIRA_USERNAME: '${{JIRA_USERNAME}}'
JIRA_API_KEY: '${{JIRA_API_KEY}}'
JIRA_ISSUE_SOURCE_FIELD: '${{JIRA_ISSUE_SOURCE_FIELD}}'
ACTION: comment_update
JIRA_COMMENT_ID: '33455'
COMMENT_BODY: New Updating from codefresh pipeline
JiraIssueCreate:
title: Add Jira Issue
type: jira-issue-manager
arguments:
JIRA_BASE_URL: 'https://company-name.atlassian.net/'
JIRA_USERNAME: '${{JIRA_USERNAME}}'
JIRA_API_KEY: '${{JIRA_API_KEY}}'
ACTION: issue_create
ISSUE_PROJECT: SA
ISSUE_SUMMARY: Brandons test 4
ISSUE_DESCRIPTION: Description inserted from codefresh pipeline
ISSUE_COMPONENTS: 'step,pov'
ISSUE_CUSTOMFIELDS:
- MY FIELD1=MYVALUE1
- customfield_10067=MYVALUE2
ISSUE_TYPE: Task
JiraIssueUpdate:
title: Update Jira Issue
type: jira-issue-manager
arguments:
JIRA_BASE_URL: 'https://company-name.atlassian.net/'
JIRA_USERNAME: '${{JIRA_USERNAME}}'
JIRA_API_KEY: '${{JIRA_API_KEY}}'
JIRA_ISSUE_SOURCE_FIELD: '${{JIRA_ISSUE_SOURCE_FIELD}}'
ACTION: issue_update
ISSUE_SUMMARY: Brandons test 3.1
ISSUE_DESCRIPTION: Description updated from codefresh pipeline
ISSUE_COMPONENTS: step
ISSUE_TYPE: Task
JiraIssueUpdateAllFromJQL:
title: Update Jira Issues From JQL Query
type: jira-issue-manager
arguments:
JIRA_BASE_URL: 'https://company-name.atlassian.net/'
JIRA_USERNAME: '${{JIRA_USERNAME}}'
JIRA_API_KEY: '${{JIRA_API_KEY}}'
ACTION: update_all_from_jql_query
ISSUE_DESCRIPTION: Update from JQL Query
ISSUE_COMPONENTS: 'step,pov'
ISSUE_TYPE: Task
JQL_QUERY: project=SA and summary~"Brandons testing*" and assignee = currentUser()
JQL_QUERY_MAX_RESULTS: '50'
JiraIssueVerifyStatus:
title: Verify Issue Status on Single Issue
type: jira-issue-manager
arguments:
JIRA_BASE_URL: 'https://company-name.atlassian.net/'
JIRA_USERNAME: '${{JIRA_USERNAME}}'
JIRA_API_KEY: '${{JIRA_API_KEY}}'
JIRA_ISSUE_SOURCE_FIELD: '${{JIRA_ISSUE_SOURCE_FIELD}}'
ACTION: verify_status
DESIRED_ISSUE_STATUS: Blocked
JiraIssueVerifyStatusAllFromJQL:
title: Verify Issue Status on Issues from JQL Query
type: jira-issue-manager
arguments:
JIRA_BASE_URL: 'https://company-name.atlassian.net/'
JIRA_USERNAME: '${{JIRA_USERNAME}}'
JIRA_API_KEY: '${{JIRA_API_KEY}}'
ACTION: verify_status
DESIRED_ISSUE_STATUS: Blocked
JQL_QUERY: project=SA and summary~"Brandons testing*" and assignee = currentUser()
JiraIssueTransitionStatus:
title: Transition the Issue status on a single item
type: jira-issue-manager
arguments:
JIRA_BASE_URL: 'https://company-name.atlassian.net/'
JIRA_USERNAME: '${{JIRA_USERNAME}}'
JIRA_API_KEY: '${{JIRA_API_KEY}}'
JIRA_ISSUE_SOURCE_FIELD: '${{JIRA_ISSUE_SOURCE_FIELD}}'
ACTION: issue_transition
DESIRED_ISSUE_STATUS: Blocked
VERBOSE: true
JiraIssueTransitionStatusAndUpdate:
title: Transition the Issue status and update a single item
type: jira-issue-manager
arguments:
JIRA_BASE_URL: 'https://company-name.atlassian.net/'
JIRA_USERNAME: '${{JIRA_USERNAME}}'
JIRA_API_KEY: '${{JIRA_API_KEY}}'
JIRA_ISSUE_SOURCE_FIELD: '${{JIRA_ISSUE_SOURCE_FIELD}}'
ACTION: issue_transition_and_update
DESIRED_ISSUE_STATUS: Blocked
ISSUE_DESCRIPTION: Updated while transitioning status
VERBOSE: true