Skip to content

Commit

Permalink
Add backlogtool token
Browse files Browse the repository at this point in the history
  • Loading branch information
shomatan committed Dec 12, 2017
1 parent fc00e56 commit 8f16895
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion common
1 change: 1 addition & 0 deletions src/main/resources/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ application {
title = ${application.name} ${application.version} (c) nulab.inc
export-limit-at-once = 100
mixpanel.token = "6aad3862b3514d664ebb4501f86f42c8"
mixpanel.backlogtool.token = "6aad3862b3514d664ebb4501f86f42c8"
mixpanel.product = "jira"
language=default
akka.mailbox-pool = 100
Expand Down
24 changes: 15 additions & 9 deletions src/main/scala/com/nulabinc/backlog/j2b/cli/Tracker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,23 @@ trait Tracker extends BacklogConfiguration {
def tracking(config: AppConfiguration, spaceService: SpaceService, userService: UserService) = {
Try {
val environment = spaceService.environment()
val data = TrackingData(product = mixpanelProduct,
envname = environment.name,
spaceId = environment.spaceId,
userId = userService.myself().id,
srcUrl = config.jiraConfig.url,
dstUrl = config.backlogConfig.url,
srcProjectKey = config.jiraConfig.projectKey,
dstProjectKey = config.backlogConfig.projectKey,
val data = TrackingData(
product = mixpanelProduct,
envname = environment.name,
spaceId = environment.spaceId,
userId = userService.myself().id,
srcUrl = config.jiraConfig.url,
dstUrl = config.backlogConfig.url,
srcProjectKey = config.jiraConfig.projectKey,
dstProjectKey = config.backlogConfig.projectKey,
srcSpaceCreated = "",
dstSpaceCreated = spaceService.space().created)
MixpanelUtil.track(token = mixpanelToken, data = data)
val backlogToolEnvNames = Seq(
"backlogtool",
"us-6"
)
val token = if (backlogToolEnvNames.contains(environment.name)) mixpanelBacklogtoolToken else mixpanelToken
MixpanelUtil.track(token = token, data = data)
}
}
}

0 comments on commit 8f16895

Please sign in to comment.