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


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

|  |  |  |  |
| --- | --- | --- | --- |
| **Syntax** | createSprint(rapidViewId, sprintName) | **Package** |  |
| **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Creates a new sprint for the provided rapid view.

Creates a new sprint for the provided rapid view.

## Parameters

| Parameter name | Type | Required | Description |
| --- | --- | --- | --- |
| rapidViewId | Number | Yes | The rapid view id. |
| sprintName | String | Yes | The name of the sprint. |
| startDate | Date | Yes | The start date of the sprint. |
| endDate | Date | Yes | The end date of the sprint. |

## Return Type

**Number**

Returns the id of the created sprint.

## Examples

### Example 1

When created with this syntax, the new sprint will be in the "feature" state which means that the sprint is not started yet.

```
number newSprintId = createSprint(1, "Sprint");
runnerLog("The sprint was created with the id: "+newSprintId);
```

Result: A new sprint with the name "Sprint" is created on the rapid vie with the id 1.

### Example 2

By entering the starting date and the ending date the script will be automatically planned and its state will be "active".

```
number newSprintId = createSprint(1, "Sprint", "06/Apr/19 10:00 AM", "20/Apr/19 08:00 AM");
runnerLog("The sprint was created with the id: "+newSprintId);
```

Result: A new sprint with the name "Sprint" is created on the rapid view with id 1 and the starting date 06/Apr/19 10:00 AM and the ending date 20/Apr/19 08:00 AM.

> ⚠️ 1. If there is no board with that name or id, an exception will be raised.
> ⚠️ 2. The user must have sufficient permissions to view the board.

## See also

> Macro (contentbylabel)

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