| Total Complexity | 3 |
| Total Lines | 20 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from lib.base import BaseJiraAction |
||
| 9 | class CreateJiraIssueAction(BaseJiraAction): |
||
| 10 | |||
| 11 | def run(self, summary, type, description=None, |
||
| 12 | project=None, extra_fields=None): |
||
| 13 | project = project or self.config['project'] |
||
| 14 | data = { |
||
| 15 | 'project': {'key': project}, |
||
| 16 | 'summary': summary, |
||
| 17 | 'issuetype': {'name': type} |
||
| 18 | } |
||
| 19 | |||
| 20 | if description: |
||
| 21 | data['description'] = description |
||
| 22 | |||
| 23 | if extra_fields: |
||
| 24 | data.update(extra_fields) |
||
| 25 | |||
| 26 | issue = self._client.create_issue(fields=data) |
||
| 27 | result = to_issue_dict(issue) |
||
| 28 | return result |
||
| 29 |