Skip to content

Adding Web Environment Info to IssueField #71

@jrobinsonadrenaline

Description

@jrobinsonadrenaline

Currently my app utilizes the Jira Issue Collector Plugin for users to submit help requests to my SM project, which by default includes an option to include details about the users web environment (Location, Referrer, User-Agent, Screen Resolution). Due to the fact that the plugin hasn't been updated in years we're getting vulnerability warnings from the Rapid7 Scans, so I'm working on creating issues with the REST API. However, I'm having trouble figuring out how to include that Environment data when creating a new issue. I see the local $environment property in the IssueField class, but not seeing any set methods, and even though that field takes a paragraph element, the property is marked as array type in that class. Is this something that is possible with this library, or will I need to manually manipulate the JSON object before passing to the IssueService Create method?

  1. The API Documentation Indicates that it accepts that variable in the formData (which I am passing from my custom form)
  2. The only place I can see reference to the environment key is in the IssueField Class

Here is the method that I'm using to generate the Issue.

`$det = new AtlassianDocumentFormat(
(new Document())
->paragraph()
->text($formData['description'])
->end()
);

    $issue = (new IssueField())
        ->setProjectKey('DTSM')
        ->setSummary($formData['summary'])
        ->setReporterName($formData['name'])
        ->addLabelAsString($_ENV['JIRA_ISSUE_LABEL'])
        ->setIssueTypeAsString($_ENV['JIRA_ISSUE_TYPE'])
        ->addCustomField('customfield_10101', $formData['email'])
        ->setDescription($det);

    (new IssueService())->create($issue);`

Library version: "lesstif/jira-cloud-restapi": v1.6.2

Any assistance is greatly appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions