Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Multiple API calls to Jira - error

Hi,

 

not exactly sure if this can be done but this is what I'm trying to do.

I have a query that generates dates between a given period:

 

let
    StartDate = #date(prmBaseCalendarStartYear,1,1),
    EndDate = #date(prmBaseCalendarEndYear,1,10),
    NumberOfDays = Duration.Days( EndDate - StartDate ),
    Dates = List.Dates(StartDate, NumberOfDays+1, #duration(1,0,0,0)),
    #"Converted to Table" = Table.FromList(Dates, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Column1", "Date"}}),
    #"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"Date", type date}})
in
    #"Changed Type"

 

And query returns the following result.

Scr1.png

 

I want to call Jira API for every date and return results in a table, so I have created a function with following code:

(prmdate as date) =>
let 
    #"Source" = Json.Document((Web.Contents("https://issuetracker.site.com/jira/rest/api/2/search?jql=project=myproject+AND+issuetype+IN+(Incident,+Bug)+AND+createdDate<="&Date.ToText([prmdate],"yyyy-MM-dd")&"+AND+status+WAS+NOT+IN+('Development done', +'Ready for testing', +'In Testing', +Tested, +'Under review', +Closed)+ON+"&Date.ToText([prmdate],"yyyy-MM-dd"))))
in
    #"Source"

 

 

Invoking this function gives me the following error:

Scr2.png

My idea was to call this function from Custom Column in Dates table and expand table for columns in response result.

Can this be done and how? 

 

Thanks in advance....

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@Anonymous 

 

You may just remove square brackets.

Date.ToText(prmdate
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-chuncz-msft
Community Support
Community Support

@Anonymous 

 

You may just remove square brackets.

Date.ToText(prmdate
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

That worked like a charm. 🙂 Thank you!

Any suggestions on the first part of the problem? How to fill in dates table with data retrieved by function....

Anonymous
Not applicable

Anyone? 🙂

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.