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

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Unable to set Original Estimate on a task using VBA/REST - Error code 400 Edited



I am trying to log work estimates via a REST API call using VBA. Here is my code. It is returning a code 400.  


Sub UpdateJIRAWorkLogs()

i = 3

sResponse = MsgBox("Click OK to begin writing to JIRA", vbOKCancel)

If sResponse = vbCancel Then
Exit Sub
End If

lRow = Worksheets("Bulk Update Worklogs").Cells(Rows.Count, 1).End(xlUp).Row

While i <= lRow
sProject = "SISBTXTRPR" 
sIssueType = "Sub-task"

sURL = ""

 sData = "{""newEstimate"": 36000}"

With JiraService
.Open "POST", sURL, False
.SetRequestHeader "Content-Type", "application/json"
.SetRequestHeader "Accept", "application/json"
.SetRequestHeader "Authorization", "Basic " & UserPassBase64
.SetRequestHeader "X-Atlassian-Token", "nocheck"
.Send (sData)

If .Status = "401" Then
MsgBox "Not authorized or invalid username/password"
End If
End With

i = i + 1


MsgBox "Insert Complete", vbInformation

End Sub


1 answer

0 votes
Andy Heinzer Atlassian Team Jan 03, 2020

Hi Balu,

I see that you are trying to make a REST API call to a Jira Cloud site.  However given the response you are seeing here, it certainly looks like your request is not authenticating as you expect here.

Instead of using the account password to do the authentication, I would recommend that you generated an API token.  You can then build a new base64 encoded string in the format of:

and then pass that string in an authorization header of the call.  More details on the steps needed to encode that string can be found in Basic auth for REST APIs.

It is quite possible that you were able to use the password instead for REST API calls to Jira Cloud. However Atlassian changed this behavior about 6 months ago. This change goes back to our Deprecation notice - Basic authentication with passwords and cookie-based authentication

In short, you can't use passwords for REST API calls to Jira Cloud sites anymore.  But you should still be able to create a token to complete basic authentication, you just need to follow the steps in that guide to make sure that you have encoded it in the correct format.

Try that first.  And let me know if that helps.


Suggest an answer

Log in or Sign up to answer

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you