Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Python - Environment is required

A_mir Murtaza
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!
November 22, 2021

I wrote a Jira-CLI script on Python that automate all issues commands.

The script working perfectly, until last week, the Admin of the account have made a few changes where he added Environment as choices field not optional but required.

So in my script when I create a new issue, I need to include Environment as required with other fields, but always getting an error from the server says:

{"errorMessages": [], "errors":{"environment": "Field 'environment' cannot be set. It is not on the appropriate screen, or uknown."}}

if no environment was included, I get this error:

{"errorMessages": [], "errors":{"environment": "Environment is required"}}

I've also tried 'Environment' but the same thing!.

Since our account is paid I tried on my demo account, the script with environment included working fine without any errors.

def create(self):
    issue_dict = {
      'project': '{'key': f"{self.args.projectKey}"}',
      'summary': ' '.join(string for string in self.args.summary) or '',
      'description': ' '.join(string for string in self.args.description),
      'issuetype': {'name': self.args.type},
      'environment': self.args.environment,
    }
    print('Create issue:', issue_dict)
    new_issue = self.auth.create_issue(fields=issue_dict)
    print('\nIssue created successfully, issue key:', new_issue, '\n')

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events