Como podemos ajudar?

p.ex. Gráfico de Gantt, Criar tarefas, Compartilhar pastas


convert the interface numeric wrikeID to the API wrike ID

1 comentário

  • Spot On! 👍 Innovative Approach 💡 Stellar Advice 💪
    Jan Dijk

    (Editado )

    i found the solution with the permalink field.

    snippit to resolve the task id by the old permalink id in powershell

    $v2wrikeid = xxxxxxx
    $wriketaskData = Invoke-RestMethod -uri$v2wrikeid -Headers @{'Authorization' = ' bearer '+$accessToken} -Method get
    echo $wrikeID


    here i share some quick and dirty code to add an time entry to a task for a whole year every workday in powershell


    #create wrike time entries for every workday for a whole year
    # uncomment the $output line to actually do it, first test the print out

    $accessToken = "yourv4token"
    # the permalinkid
    $v2wrikeid = XXXXXX

    $wriketaskData = Invoke-RestMethod -uri$v2wrikeid -Headers @{'Authorization' = ' bearer '+$accessToken} -Method get

    #Print week

    $we = [System.DayOfWeek]::Saturday, [System.DayOfWeek]::Sunday

    $date = Get-Date -Year $beginyear -Month $beginmonth -Day 1

    for ($i=$beginmonth; $i -le 12; $i++)

    $date = Get-Date -Year $beginyear -Month $i -Day 1

    $lastDay = [DateTime]::DaysInMonth($date.Year, $date.Month)
    $firstDate = [DateTime]::new($date.Year, $date.Month, 1)
    $lastDate = [DateTime]::new($date.Year, $date.Month, $lastDay)

    $workdays = 0

    while ($now -le $lastDate){

    $now = $now.AddDays(1)

    if ($now.DayOfWeek -notin $we ) {

    $payload = 'hours=0.5&trackedDate=' + ($now).Tostring("yyyy-MM-dd") + '&comment=' + ($now).Tostring("yyyy-MM-dd") + ': time entry subject |'
    #uncomment to actually output, test it manually first before you loop.
    ##$output = Invoke-RestMethod -uri$wrikeID/timelogs -Headers @{'Authorization' = ' bearer '+$accessToken} -Method Post -body $payload
    Remove-Variable payload




    Is this helpful? 1
    Ações de comentário Permalink

Por favor, entrar para comentar.

Folllowing List for Post: convert the interface numeric wrikeID to the API wrike ID
[this list is visible for admins and agents only]


Welcome 🖖

Hi there! 🙂 Want to become a black belt Wrike Ninja? Here's how to earn a Wrike badge

Welcome 🖖 Have you checked out this week's Release Notes yet?

Hey! 👋 Curious about something? Visit How To to search and ask the Community for answers.

Welcome! 👋 Figured out a good tip or trick? Share it in Best Practices.

Want to connect your existing software to Wrike? Learn and ask how in the API section.