---
title: "updateSprint"
canonical: "https://support.appfire.com/space/PSJ/15481326/updateSprint"
format: markdown
---
> Macro (aura-html)


> 📝 The use of this function requires the Power Scripts for Jira add-on be installed and licensed.

|  |  |  |  |
| --- | --- | --- | --- |
| **Syntax** | updateSprint(sprintId, sprintName) | **Package** |  |
| **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Updates a given sprint.

Updates a given sprint.

## Parameters

| Parameter name | Type | Required | Description |
| --- | --- | --- | --- |
| sprintId | Number | Yes | The sprint id. |
| sprintName | String | Yes | The new name of the sprint. By leaving the name empty the name already defined will not be modfied. |
| state | String | Yes | The state of the sprint. There are 3 states of the sprint: 'feature', 'active' and 'closed'. |
| startDate | Date | Yes | The start date of the sprint. By leaving the date empty the start date already defined will not be modified. |
| endDate | Date | Yes | The end date of the sprint. By leaving the date empty the end date already defined will not be modified. |
| completionDate | Date | No | The completion date of the sprint. |

## Return Type

**Boolean**

Returns true if the sprint was successfully updated.

## Examples

### Example 1

```
number newSprintId = createSprint(1, "Sprint");
string nameOfNewSprint = sprintName(newSprintId);
runnerLog("The sprint was created with the id "+newSprintId+" and the name "+nameOfNewSprint);
updateSprint(newSprintId, "UpdatedSprintName");
string nameOfUpdatedSprint = sprintName(newSprintId);
runnerLog("The sprint was created with the id "+newSprintId+" and the name "+nameOfUpdatedSprint);
```

### Example 2

```
number newSprintId = createSprint(1, "Sprint"); // it's in future state initially
addIssueToSprint("AGILE-1", newSprintId);
updateSprint(newSprintId, "", "active", "06/Apr/19 10:00 AM", "20/Apr/19 08:00 AM"); //the sprint is planned and started
string nameOfUpdatedSprint = sprintName(newSprintId);
date startDate = sprintStartDate(newSprintId);
date endDate = sprintEndDate(newSprintId);
runnerLog("The sprint" + nameOfUpdatedSprint + "was created and planned!); // the name remains "Sprint"
runnerLog("It starts on " + startDate + " and ends on " + endDate);
```

### Example 3

```
number newSprintId = createSprint(1, "Sprint", "06/Apr/19 10:00 AM", "20/Apr/19 08:00 AM"); // it's in active state
addIssueToSprint("AGILE-1", newSprintId);
updateSprint(newSprintId, "", "closed", "", "","20/Apr/19"); // Spring was completed on 20/Apr/19
date completiontDate = sprintCompleteDate(newSprintId);
runnerLog("Sprint was completed on " + completionDate);
```

## See also

> Macro (contentbylabel)

> Macro (fc909b09-b512-4c31-a844-dd855b0e6aae/db1c8759-c7e5-4e80-9022-d19e47b0e2b0/static/macro)