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

Jira OAuth and Salesforce streaming #507

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 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
d821279
updating Jira readme
davidtamaki Dec 28, 2022
705fd53
update salesforce mapper and error responses
davidtamaki Jan 5, 2023
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"
}
}
}
53 changes: 47 additions & 6 deletions src/actions/jira/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,53 @@
# 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 Looker Explore query or Look.

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.
## Sending data to JIRA

2. Enable JIRA in your looker Administration page for actions (/admin/actions).
From your selected Explore or Look, click the gear menu in the upper right corner. For Looks or Explores, select **Send** for one-time deliveries. For Looks, select **Schedule** for recurring deliveries. For Explores, because there is no option to send a recurring delivery, you must select **Save & Schedule** to first save the Explore as a Look and then schedule the Look for a recurring delivery.

* Address is the url of your JIRA server: e.g. https://MYJIRA.atlassian.net
* username of the lookerbot user
* password of the lookerbot user
> For more information about scheduling data deliveries, see the [Using the Looker Scheduler to deliver content](https://cloud.google.com/looker/docs/scheduling) documentation page.

Selecting a delivery option opens the Scheduler for Explores and Looks. Enter a title for your delivery. To deliver to Jira destination:

1. Select the **JIRA** icon from the **Where should this data go?** section of the Scheduler.

1. The first time you deliver to this destination, you must authenticate with your Atlassian OAuth credentials. In the **Jira** section of the Scheduler, click the **Log in to Jira** button:

![Jira OAuth Login 1](./readmeImages/jira_oauth_1.png)

1. You will be presented with a consent screen to grant the Looker application the scope to view `jira-user` and view/update `jira-work`. Click **Accept**:

![Jira OAuth Login 2](./readmeImages/jira_oauth_2.png)

1. Back in the Jira section of the Scheduler, click the Verify credentials button.

1. Select your project from the drop-down field and fill out the remaining fields.

## Description of Form Fields

1. `Project` (_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.

1. `Issue Type` (_required_) - 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. Some custom issue types are supported, inclunding `epic` and `subtask`.

1. `Summary` (_required_) - this will be the name of the ticket.

1. `Description` (_optional_) - 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.

1. `Filename` (_optional_) - 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`).

1. `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.

1. `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, the project's field name id for epic name is retrieved from Jira before setting it with the text value of this field.

## Removal
To uninstall the Looker action, go to your Atlassian account's [Connected apps page](https://id.atlassian.com/manage-profile/apps) and click **Remove access** for the Looker application. You can get to this page by:

1. Select your profile icon in the top-right corner, and from the dropdown, select to "Manage Account":
![Jira Removal 1](./readmeImages/jira_remove_1.png)
1. Select the "Connected apps" page, then click "Remove access":
![Jira Removal 2](./readmeImages/jira_remove_2.png)


The next time the form modal is loaded from inside Looker, the login to Jira button will appear and you will be prompted to authenticate with your Atlassian OAuth credentials again.
Loading