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

Jgotlieb salesforce + Jira changes #500

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2ba7bf6
added ability to dynamically load issue types for jira action form
jasongotlieb Sep 15, 2022
3b15f9e
added support for sub-tasks and partial support for epics
jasongotlieb Sep 16, 2022
316e1a8
added support for custom field epic names
jasongotlieb Sep 20, 2022
957167e
jira auth token is refreshed on new form load
jasongotlieb Sep 20, 2022
701139d
fixed unit jira unit tests
jasongotlieb Sep 25, 2022
030e269
linting fixes
jasongotlieb Sep 25, 2022
8c655e3
more linting fixes
jasongotlieb Sep 25, 2022
c6cd1b0
more linting
jasongotlieb Sep 25, 2022
621029a
last lint fix
jasongotlieb Sep 25, 2022
5886c2f
added oauth steps to readme
jasongotlieb Sep 27, 2022
2bcc4b0
added readme formatting
jasongotlieb Sep 27, 2022
0b0bfd2
displaying more images
jasongotlieb Sep 27, 2022
fe28627
ran linting and tests again and added space to readme
jasongotlieb Sep 27, 2022
cd9c8d6
added field descriptions to readme
jasongotlieb Sep 27, 2022
6bb305d
added batches with streaming to allow for more sf campaign updates in…
jasongotlieb Nov 11, 2022
e27db6f
lint fixes
jasongotlieb Nov 11, 2022
ed52b12
lint fixes;
jasongotlieb Nov 11, 2022
c8da6bd
removed unused object
jasongotlieb Nov 11, 2022
b5dc85c
streaming data to sf action
jasongotlieb Nov 22, 2022
eb4d043
ran linter
jasongotlieb Nov 22, 2022
518d505
lint fixes
jasongotlieb Nov 22, 2022
baa3794
lint fixes
jasongotlieb Nov 22, 2022
38e872e
updated unit test
jasongotlieb Nov 22, 2022
7b97225
unit test update
jasongotlieb Nov 22, 2022
3b855b7
update to download settings
jasongotlieb Nov 22, 2022
915e043
update unit test
jasongotlieb Nov 22, 2022
540e0e0
updated error mesasging in sf action and removed unused dependency
jasongotlieb Nov 23, 2022
c6f5285
dedupe code
jasongotlieb Nov 23, 2022
072cecb
lint fixes
jasongotlieb Nov 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
},
"license": "MIT",
"dependencies": {
"adf-builder": "^3.3.0",
"@google-cloud/storage": "^1.5.2",
"@hubspot/api-client": "^2.0.1",
"@sendgrid/helpers": "7.2.0",
Expand All @@ -55,7 +56,7 @@
"@types/twilio": "^2.11.0",
"@types/uuid": "^3.4.9",
"@types/winston": "^2.4.4",
"airtable": "^0.11.4",
"airtable": "^0.7.2",
"analytics-node": "^3.3.0",
"async-mutex": "^0.1.4",
"aws-sdk": "^2.732.0",
Expand All @@ -70,11 +71,12 @@
"dropbox": "^2.5.13",
"express": "^4.17.1",
"express-winston": "^2.6.0",
"firebase-admin": "^10.0.0",
"googleapis": "^59.0.0",
"hipchatter": "^1.0.0",
"i18n-iso-countries": "^7.1.0",
"jira-client": "^6.18.0",
"jsforce": "^1.10.1",
"jsforce": "^1.11.0",
"mailchimp": "^1.2.1",
"node-marketo-rest": "^0.7.8",
"nodemailer": "^6.6.1",
Expand All @@ -96,7 +98,6 @@
"typescript": "^3.9.7",
"uuid": "^3.4.0",
"winston": "^2.4.5",
"firebase-admin": "^10.0.0",
"yarn": "^1.22.18"
},
"typings": "lib/index",
Expand Down Expand Up @@ -140,4 +141,4 @@
"sinon-express-mock": "^2.2.1",
"tslint": "^5.20.1"
}
}
}
62 changes: 56 additions & 6 deletions src/actions/jira/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,62 @@
# JIRA
## Create a JIRA issue referencing data

This action will create a JIRA Issue referencing data from a Look. You will first create a LookerBot user so that the creator of an issue is clear. You will then be able to create issues in any JIRA project that the LookerBot has access to referencing a Look.
This action will create a JIRA Issue referencing data from a Look.
In order to enable the action, you need a `JIRA_CLIENT_ID` and `JIRA_CLIENT_SECRET` in your action hub enviornment file. To properly set that up, follow the steps in JIRA Action Oauth Setup.
Once you have completed the Oauth setup, trigger the JIRA action just like you would any other. When prompted, `login` with your JIRA username and password and then `verify credentials` and then you can start creating tickets.

1. Create a lookerbot user in your JIRA user [administration console](https://MYJIRA.atlassian.net/admin/users). Take note of the username and password you give to the lookerbot.
## JIRA Action Oauth Setup

2. Enable JIRA in your looker Administration page for actions (/admin/actions).
1. Create a JIRA account or use the account you want your action hub tickets to be associated with.

* Address is the url of your JIRA server: e.g. https://MYJIRA.atlassian.net
* username of the lookerbot user
* password of the lookerbot user
2. Navigate to the Atlassian developer console https://developer.atlassian.com/console/myapps/

3. Click the create button to create an “OAUTH 2.0 Integration”
![OAUTH 2.0 Integration](./readmeImages/oAuthStep3.png)

4. Name your app and agree to the terms
![Name your app](./readmeImages/oAuthStep4.png)

5. Click on the “Distribution” tab then the “Edit” button. Then make sure your app’s “Distribution Status” are set to “Not Sharing”. Save your changes.
![Not sharing](./readmeImages/oAuthStep5.png)

6. Click on the “Permissions” tab.
![Permissions](./readmeImages/oAuthStep6.png)

7. Click “Add” or “Configure” for “User Identity API”. Click “Edit Scopes” and select “View active user profile”
![User Identity API](./readmeImages/oAuthStep7.png)

8. Click “Add” or “Configure” for “Jira API”. Click “Edit Scopes” and select “View Jira issue data”, “View user profiles”, and “Create and manage issues”
![JIRA API](./readmeImages/oAuthStep8.png)

9. Click “Add” or “Configure” for “Personal data reporting API”. Click “Edit Scopes” and select “Personal data reporting API”
![Personal data reporting API](./readmeImages/oAuthStep9.png)

10. Click the “Authorization” tab. Click “Add” or “Configure” for “OAuth 2.0 (3LO)”
![Auth tab](./readmeImages/oAuthStep10.png)

11. Enter your callback url for your action hub. ie. `https://your_https_web_hosted_address.com/actions/jira_create_issue/oauth_redirect`

12. Make sure all changes have been saved. Then click on the “Settings” tab and scroll to “Authentication Details”. Here you have your app’s client id and secret.

13. Copy and paste the client id and secret into the .env file in your local action hub repo.
```
JIRA_CLIENT_ID=client id
JIRA_CLIENT_SECRET=secret
```

## Description of Form Fields

1. `Project` - this field is required. The project selection determines the jira project where the new jira ticket will be created. The list of projects is pulled from the authenticated user's jira instance and the projects therein.

2. `Issue Type` - these are the different types of issues a user can create for a given project. The issue type is required and the selection options are pulled from the selected project. Only issue types supported by a given project will be displayed. Issue types are `bug` or `task` or the like. We support some custom issue types as well as `epic` and `subtask`.

3. `Summary` - this will be the name of the ticket. It is a string and it is required.

4. `Description` - this is an optional text field. If you give your ticket a description here, it will show up in the newly created jira ticket after you save.

5. `Filename` - this is not required. The filename will be the name of the data plot that gets attached to your new jira ticket. If you leave it blank, a name will be used based on the action hub's suggestion (see `ActionRequest.suggestedFilename`.

6. `Parent Issue` - this field is only required (and only shows up) if you choose to create a new jira issue with the issueType `subtask`. Subtask issue types require a linked parent issue. This field is populated by pulling all `standardIssueTypes` from the selected project. The user can select the parent issue from this list.

7. `Epic Name` - if the selected project supports epic issue types and the `epic` issue type is selected, this field shows up and is required. It will determine the name of the new epic being created. Because epic is a custom field, we pull the project's field name id for epic name from jira before setting it with the text value of this field.
Loading