Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.
Hi, I tried looking ina few topics like :https://community.powerbi.com/t5/Desktop/Connecting-Jira-to-Power-BI-using-the-Web-API/td-p/838130
But i can not get my code to work.
What I have is below:
let
BaseUrl = "https://autoleadstar.atlassian.net/rest/api/2/issue/createmeta",
Credentials = "XXXX@email.com:My_token",
JiraIDPerPage = 1000,
GetJson = (Url) =>
let
RawData = Web.Contents(Url,[Headers=[Authorization="Basic " & Credentials]]),
Json = Json.Document(RawData)
in Json,
GetJiraIDCount = () =>
let Url = BaseUrl & "&maxResults=0",
Json = GetJson(Url),
Count = Json[#"total"]
in Count,
GetPage = (Index) =>
let Skip = "&startAt=" & Text.From(Index * JiraIDPerPage),
Top = "&maxResults=" & Text.From(JiraIDPerPage),
Url = BaseUrl & Skip & Top,
Json = GetJson(Url),
Value = Json[#"issues"]
in Value,
JiraIDCount = List.Max({ JiraIDPerPage, GetJiraIDCount() }),
PageCount = Number.RoundUp(JiraIDCount / JiraIDPerPage),
PageIndices = { 0 .. PageCount - 1 },
Pages = List.Transform(PageIndices, each GetPage(_)),
JiraID = List.Union(Pages),
Table = Table.FromList(JiraID, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(Table, "Column1", {"id", "key", "fields"}, {"Column1.id", "Column1.key", "Column1.fields"})
in
Table
I get the following error:
"We couldn't authenticate with the credentials provide. Please try again."
Any tips on how to proceed?
Solved! Go to Solution.
Hi @Laila92
From your code I think you want to use a REST API as a data source.
Please check whether your access token is correct.
...
Credentials = "XXXX@email.com:My_token",
...
etJson = (Url) =>
let
RawData = Web.Contents(Url,[Headers=[Authorization="Basic " & Credentials]]),
You can try to use web connector in Power BI to connect to your data source. You can add your authentication and other parameters you need in HTTP request header parameters in Advancd.
For reference: Using a REST API as a data source
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Laila92
You can consider using Power BI Connector for Jira as one more way to solve your issue.
Liubov
I was able to connect, but am only getting an empty table back. Any idea why that is?
Hi @Laila92
From your code I think you want to use a REST API as a data source.
Please check whether your access token is correct.
...
Credentials = "XXXX@email.com:My_token",
...
etJson = (Url) =>
let
RawData = Web.Contents(Url,[Headers=[Authorization="Basic " & Credentials]]),
You can try to use web connector in Power BI to connect to your data source. You can add your authentication and other parameters you need in HTTP request header parameters in Advancd.
For reference: Using a REST API as a data source
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2023 Power BI update to learn about new features.
Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.