Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

is there a way to export issues fields of a JQL to google sheet automatically?

i want to export issues details automatically to google sheet based on JQL on a special time trigger for example export issues automatically on a daily basis

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Vikrant Yadav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Sep 10, 2023

Hi @mahdi shirgholami I am not sure how to do it on google sheet. But in MS Excel you can do it via JQL REST API 

Get Data in Excel from Web > enter JIRA jql get request. In Power Query editor select the fields which you want add as column. 

thanks for your answer vikrant, you mean to do it with scriptrunner? 

i tried this script but i get some errors and don't know how to deal with it 

import groovy.json.JsonOutput
import groovy.json.JsonSlurper
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.search.SearchRequest
import com.atlassian.jira.issue.search.SearchRequestManager
import com.atlassian.jira.security.JiraAuthenticationContext
import com.atlassian.jira.user.ApplicationUser
import com.onresolve.scriptrunner.runner.customisers.PluginModule
import com.onresolve.scriptrunner.runner.customisers.WithPlugin
import com.onresolve.scriptrunner.runner.rest.common.CustomEndpointDelegate
import com.atlassian.jira.util.json.JSONObject
import com.atlassian.jira.web.bean.PagerFilter

@WithPlugin("com.atlassian.jira.plugins.jira-importers-plugin")
@PluginModule
CustomEndpointDelegate customEndpointDelegate

def jiraAuthenticationContext = ComponentAccessor.getComponent(JiraAuthenticationContext)
def searchRequestManager = ComponentAccessor.getComponent(SearchRequestManager)

def currentUser = jiraAuthenticationContext.loggedInUser
def savedFilterId = 12345 // Replace with the ID of your saved filter
def cronExpression = "0 0 * * * ?" // Schedule for daily export at midnight

// Function to create a scheduled export
def createScheduledExport() {
def savedFilter = searchRequestManager.getSavedFilter(currentUser, savedFilterId as Long)

if (savedFilter) {
def endpointUrl = "/rest/api/2/filter/${savedFilter.id}/export"
def requestBody = new JSONObject([
"cronExpression": cronExpression,
"enabled": true
])

def response = customEndpointDelegate.post(endpointUrl, JsonOutput.toJson(requestBody))

if (response.status == 200) {
return "Scheduled export created successfully."
} else {
return "Failed to create scheduled export."
}
} else {
return "Saved filter with ID $savedFilterId not found."
}
}

// Call the function to create the scheduled export
def result = createScheduledExport()

return result

TAGS
AUG Leaders

Atlassian Community Events