Skip to content

Conversation

@be-kate
Copy link
Contributor

@be-kate be-kate commented Aug 19, 2025

Default access to attribute was giving exceptions when accessing the Jira issues without descriptions.
Sample:

{
  "stdout": "",
  "stderr": "Traceback (most recent call last):\n  File \"/opt/stackstorm/st2/lib/python3.8/site-packages/python_runner/python_action_wrapper.py\", line 395, in <module>\n    obj.run()\n  File \"/opt/stackstorm/st2/lib/python3.8/site-packages/python_runner/python_action_wrapper.py\", line 214, in run\n    output = action.run(**self._parameters)\n  File \"/opt/stackstorm/packs.dev/jira/actions/get_issue.py\", line 14, in run\n    result = to_issue_dict(issue=issue, include_comments=include_comments,\n  File \"/opt/stackstorm/packs.dev/jira/actions/lib/formatters.py\", line 36, in to_issue_dict\n    'description': issue.fields.description,\nAttributeError: 'PropertyHolder' object has no attribute 'description'\n",
  "exit_code": 1,
  "result": "None"
}

Fix:
Added verification that attribute exists before accessing it. Result:

{
  "stdout": "",
  "stderr": "",
  "exit_code": 0,
  "result": {
    "id": "1454821",
    "key": "OPS-12345",
    "url": "https://xyz.atlassian.net/browse/OPS-45131",
    "summary": "NodeXYZ - 2025-07-22T15:11:44",
    "description": null,
    "status": "In Progress",
    "priority": null,
    "resolution": null,
    "labels": [],
    "reporter": "Awesome Person",
    "assignee": "Cute Person",
    "created_at": "2025-07-22T11:11:36.176-0400",
    "updated_at": "2025-07-22T19:32:44.932-0400",
    "resolved_at": null
  }
}

@be-kate be-kate requested review from a team and floatingstatic as code owners August 19, 2025 20:48
@be-kate be-kate requested review from khushboobhatia01 and removed request for a team August 19, 2025 20:48
@be-kate be-kate force-pushed the be-kate/add-description-attribute-verification branch 2 times, most recently from b6d83e5 to 125ffd2 Compare August 19, 2025 20:56
@be-kate be-kate force-pushed the be-kate/add-description-attribute-verification branch from 125ffd2 to abe12ad Compare August 19, 2025 20:59
Copy link
Collaborator

@floatingstatic floatingstatic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution! Looks good to me!

@floatingstatic floatingstatic merged commit a1c8c54 into StackStorm-Exchange:master Aug 20, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

3 participants