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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • 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

How to add log work time spent via REST

Im working on C# application, I need to REST method to update log work (time spent) on a particular issue.
how can I achieve this?

Thanks and regards,

Irantha

1 answer

0 votes
Andy Heinzer Atlassian Team Sep 23, 2020

Hi,

The process to add a worklog to an issue in Jira via REST is pretty straightforward in general, but I have to admit that I am not well versed in the use of C# programming language. 

Each of those documents have examples of using this endpoint.  For the Cloud version there are curl, php, node.js, java, and python specific syntax listed there that can help.  I am not sure of the exact C# syntax here, but it would have to follow the same headers/endpoint/payload being sent as the other examples.

For example, if you're using Jira Cloud, basic auth, and curl, you could send a request such as

curl --request POST \
  --url 'https://your-domain.atlassian.com/rest/api/3/issue/{issueIdOrKey}/worklog' \
  --header 'Authorization: Basic [base64encodedstring]' \
  --header 'Accept: application/json' \
  --header 'Content-Type: application/json' \
  --data '{
  "timeSpentSeconds": 12000,
  "started": "2020-09-23T07:30:36.640+0000"
}'

Of course you would need to substitute your URL, and IssueKey to make this work, but this is how it can be done. I also ran across another thread such as https://community.atlassian.com/t5/Answers-Developer-Questions/Using-c-to-access-jira-cloud-issues/qaq-p/535374 in which another user found the use of RestSharp to be helpful in being able to make such REST calls from C Sharp.

I hope this helps.

Andy

Suggest an answer

Log in or Sign up to answer
TAGS

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