Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How can I add custom or standard variables in the following pipe: jira-create-issue:0.2.0

Rohan Bhardwaj
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 21, 2021

I integrated jira-create-issue:0.2.0 in my pipeline. Defined IssueType is getting created successfully in my project.

My query is, how can I add more variables in the following snippet? I want to use as many fields as possible while creation.

script:
  - pipe: atlassian/jira-create-issue:0.2.0
    variables:
      JIRA_BASE_URL: "<string>"
      JIRA_USER_EMAIL: "<string>"
      JIRA_API_TOKEN: "<string>"
      JIRA_PROJECT: "<string>"
      JIRA_ISSUE_SUMMARY: "<string>"

I tried to add one Standard variable "assignee":"<accountID>", but after the issue is created, the Assignee field remains blank. (There is not error returned though after script)

2 answers

1 accepted

1 vote
Answer accepted
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 23, 2021

Hi @Rohan Bhardwaj . Thanks for your question.

As far as i understand according to jira-rest-api-examples and  jira-api-python you can add assignee only on update request, not on create.

Custom fields are supported by the api but not on the pipe.

We will think about  implementing custom fields logic and example, assignee logic and example. We will notify you when these features becomes available.

Regards, Igor.

Rohan Bhardwaj
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 23, 2021

Thank you very much @Igor Stoyanov I am eagerly waiting for the implementation

0 votes
Igor Stoyanov
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 5, 2024

Hi @Rohan Bhardwaj . We released a new version of the pipe with support of JIRA_ASSIGNEE and JIRA_CUSTOM_FIELDS.

Create an issue with assignee:

script:
  - pipe: atlassian/jira-create-issue:0.6.0
    variables:
      JIRA_BASE_URL: $JIRA_BASE_URL
      JIRA_USER_EMAIL: $JIRA_USER_EMAIL
      JIRA_API_TOKEN: $JIRA_API_TOKEN
      JIRA_PROJECT: "PROJ"
      JIRA_ISSUE_SUMMARY: "This is a sample issue summary"
      JIRA_ASSIGNEE: "<accountId>"

Create an issue with custom fields (look at the Prerequisites to get info about how to add/retrieve custom fields):

script:
  - pipe: atlassian/jira-create-issue:0.6.0
    variables:
      JIRA_BASE_URL: $JIRA_BASE_URL
      JIRA_USER_EMAIL: $JIRA_USER_EMAIL
      JIRA_API_TOKEN: $JIRA_API_TOKEN
      JIRA_PROJECT: "PROJ"
      JIRA_ISSUE_SUMMARY: "This is a sample issue summary"
      JIRA_CUSTOM_FIELDS: >
        {
            "customfield_10034": "Free text goes here.  Type away!",
            "customfield_10035": 42.07
        }

Regards, Igor

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events