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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,606
Community Members
 
Community Events
185
Community Groups

update the time estimation through the JIRA REST API

Edited

I am struggling to update the time estimation through the API, can anybody help me regarding this issue?

Is it possible to update following attributes through the API? (aggregatetimeoriginalestimate,
timeestimate, timeoriginalestimate, aggregatetimeestimate, aggregateprogress, progress)

Thanks!

2 comments

I have to update this property.toupdate.png

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Aug 23, 2017

No, because they're not attributes or fields you set, they're calculated from the issue data.

See https://developer.atlassian.com/jiradev/jira-apis/jira-rest-apis/jira-rest-api-tutorials/updating-an-issue-via-the-jira-rest-apis and https://docs.atlassian.com/jira/REST/server/#api/2/issue-editIssue - you're looking for the "timetracking" field.

You can set one or both parts of it - originalestimate and remainingestimate.  The attributes you are looking for are then calculated from those two and the worklogs on the issue.

it does not work for me...

JSON which I received is:

{
    errorMessages :
    [],
    errors :
    {
        timetracking : "Field 'timetracking' cannot be set. It is not on the appropriate screen, or unknown."
    }
}

 

 

in the same way I am also able to set a description, that means that my request is right.

What should I do?

the issue, in which I want to change the property "Estimated", this property is already set. (Even though updating does not work)

Second question regarding this topic were, what do I do if this property is not set?

Thanks a lot!

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Aug 28, 2017

You need to put the timetracking field on the edit screen for the issues.

It doesn't matter if it's got a value or not, you just set it

Like Dieter Vekeman likes this

>>You need to put the timetracking field on the edit screen for the issues.

I didnt get it

Like Nicolas Desjardins likes this

Nic could define it more precisely

thank you!

Prem Chudzinski _extensi_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
Apr 12, 2018
import groovyx.net.http.FromServer
import groovyx.net.http.HttpBuilder
import io.extensi.build.rest.jira.Field
import org.slf4j.Logger
import org.slf4j.LoggerFactory

class DetailsUpdate {


static final Logger LOG = LoggerFactory.getLogger(DetailsUpdate.class)

def static updateEstimate(int estimate, String issueId, int rapidViewId, HttpBuilder client, String authString) {
LOG.info("")
LOG.info("----------------------------------------------------------")
LOG.info("updateEstimate")
LOG.info("----------------------------------------------------------\n")

def fields = Field.getFields(client, authString)
def storyPointField = fields.find { it.name == "Story Points" }

client.post() {
request.uri.path = '/secure/DetailsViewAjaxIssueAction.jspa'
request.contentType = 'application/x-www-form-urlencoded'
request.headers = [
'X-Atlassian-Token': "no-check",
'Authorization' : "Basic ${authString}",
'Accept' : "text/html"
]

request.uri.query = ['decorator' : 'none']

request.body = ["${storyPointField.id}" : estimate,
issueId:issueId,
singleFieldEdit:true,
fieldsToForcePresent: storyPointField.id,
skipScreenCheck:true,
rapidViewId:rapidViewId]



response.success { FromServer resp, Object body ->
assert resp.statusCode == 200
}

response.failure { FromServer resp, Object body ->
LOG.error("Call failed with code ${resp.statusCode} ")

throw new RuntimeException(resp.message)
}
}

}

}

Comment

Log in or Sign up to comment