JIRA REST API: Can I set the created/modified date while creating issue ?

Suresh Kumar January 11, 2017

Is there any method or script in JIRA REST API where i  can  set the created/modified date while creating issue.

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

3 votes
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.
January 11, 2017

No.

The REST API respects what the core of JIRA does.  The created date is the date the issue was put into the system, and the updated date the last time it was updated.  Neither of which are modifiable.

Suresh Kumar January 11, 2017

and the same strategy for comments also ?

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.
January 11, 2017

Yes.  It records the date you make the comment.

Suresh Kumar January 11, 2017

Actually i have bunch of Jsons imported issues from basecamp . So how could i able to create legacy of issues and comments  to maintain my history of projects . is there any way ? 

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.
January 11, 2017

imports can set dates, as the assumption is that they were made in a different system which captured them. 

Take a look at Admin -> Import and see which one of the built-in importers might work best for you.

Like Ryan Cooper likes this
djohnson July 10, 2023

@Nic Brough -Adaptavist- How about setting the due date and priority when you create the issue is that supported? I thought it was but when sending this payload 

$subtask_body = @{
        fields = @{
            duedate = $duedate
            priority = "Highest"
            project = @{
                key = $projectKey
            }
            parent = @{
                key = $issue.key
            }
            summary = "This vendor is 21 days from their next review date $duedate"
            description = "Please review this vendor's risk score and update the appropriate custom fields before $duedate"
            issuetype = @{
                name = "Sub-task"
            }
            $subtask_duedate_id = $duedate
        }
To this endpoint, /rest/api/2/issue/ I receive a 400 error when trying to set the due date and priority. When I exclude these lines the sub task is created without any issues.
Ryan Cooper August 13, 2023

Possibly related, albeit an old post. I was getting this API error: "Field 'priority' cannot be set. It is not on the appropriate screen, or unknown." . This was because I was trying to set priority via the API before I actually added the priority field to the issue screen. I found that confusing at first - because you can see priority in some notifications even if its not included on the issue screen.

To add priority to the issue screen, highlight an issue -> click the [...] -> configure -> search for system field "Priority" -> drag that to the description fields area. Once you add the field, it works using syntax in the Create Issue REST API method by adding a value under the fields node like: "priority": {"name""Highest"}