Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to create an issue with a custom field #44

Closed
rrahman-nv opened this issue Oct 1, 2021 · 2 comments
Closed

Unable to create an issue with a custom field #44

rrahman-nv opened this issue Oct 1, 2021 · 2 comments

Comments

@rrahman-nv
Copy link

rrahman-nv commented Oct 1, 2021

Hello,

I am attempting to update a custom field, which is mandatory and has a drop down list. I am able to create the issue using the REST API using POSTMAN, with the body being as follows:

{
    "fields": {
        "project": {
            "key": "GN"
        },
        "summary": "test REST.",
        "description": "Creating of an issue using project keys and issue type names using the REST API please delete",
        "issuetype": {
            "name": "Incident"
        },
        **"customfield_10208": {"value": "NPA-BAL2-DC" }**
    }
}

However when I attempt to provide the same custom field into the "extra_fields" parameter of the create_issue action in ST2, it throws an error:


{
  "stdout": "",
  "stderr": "/opt/stackstorm/virtualenvs/jira/lib/python3.6/site-packages/urllib3/connectionpool.py:1020: InsecureRequestWarning: Unverified HTTPS request is being made to host 'servicedesk.nvidiangn.net'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
  InsecureRequestWarning,
/opt/stackstorm/virtualenvs/jira/lib/python3.6/site-packages/urllib3/connectionpool.py:1020: InsecureRequestWarning: Unverified HTTPS request is being made to host 'servicedesk.nvidiangn.net'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
  InsecureRequestWarning,
/opt/stackstorm/virtualenvs/jira/lib/python3.6/site-packages/urllib3/connectionpool.py:1020: InsecureRequestWarning: Unverified HTTPS request is being made to host 'servicedesk.nvidiangn.net'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
  InsecureRequestWarning,
/opt/stackstorm/virtualenvs/jira/lib/python3.6/site-packages/urllib3/connectionpool.py:1020: InsecureRequestWarning: Unverified HTTPS request is being made to host 'servicedesk.nvidiangn.net'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
  InsecureRequestWarning,
/opt/stackstorm/virtualenvs/jira/lib/python3.6/site-packages/urllib3/connectionpool.py:1020: InsecureRequestWarning: Unverified HTTPS request is being made to host 'servicedesk.nvidiangn.net'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
  InsecureRequestWarning,
Traceback (most recent call last):
  File \"/opt/stackstorm/st2/lib/python3.6/site-packages/python_runner/python_action_wrapper.py\", line 395, in <module>
    obj.run()
  File \"/opt/stackstorm/st2/lib/python3.6/site-packages/python_runner/python_action_wrapper.py\", line 214, in run
    output = action.run(**self._parameters)
  File \"/opt/stackstorm/packs/jira/actions/create_issue.py\", line 27, in run
    result = to_issue_dict(issue)
  File \"/opt/stackstorm/packs/jira/actions/lib/formatters.py\", line 38, in to_issue_dict
    'labels': issue.fields.labels,
AttributeError: type object 'PropertyHolder' has no attribute 'labels'
",
  "exit_code": 1,
  "result": "None"
}

Can someone help resolve this? Is it a bug in the ST2 action?

@rrahman-nv
Copy link
Author

Further testing I did, it looks like for projects where this 'label' field exists, I am able to use ST2 to create an issue. If that 'label' field is missing in the project, then I get the above error. Can someone confirm that this behaviour is expected? Do we have to add the 'label' field in for all projects for this to work? It is not a jira specific requirement, since as mentioned above, it works fine via the REST API.

@floatingstatic
Copy link
Collaborator

@rrahman-nv Apologies for the massive delay getting a response to you. I believe this is related to #53 which was addressed in a recent PR (#59) that was merged. I believe version 2.4.0 of this pack resolves the problem you are experiencing. I am going to close this issue out, but please re-open if you are still experiencing a problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants