SprintID in CreateIssueModal

Hi, I’m using CreateIssueModal, but I’m finding that I can’t specify sprintID, and Team fields in the context, is there another way to be able to specify these fields, or is it just not possible.

Thanks in advance.

Welcome to the Atlassian Developer Community, @Theo!

Yes, you are right; the sprintId and the Team custom fields are not part of the CreateIssueModal context.

Since you want to set these fields, you can try calling the Edit issue REST API and supply the sprintId and Team custom fields there.

Hope this helps, and do let us know if the above approach works for your use case.


1 Like

Thank you for your reply.

I can’t use the REST API as the issue is not yet created.

I would like to prefill the sprint field on the create issue screen. Jira does this when you create an issue from a future sprint in the ‘agile backlog’ view. So, I believe it is feasible, but I can’t find any way to do it from the documentation.

Could you advise?

Yes, this is correct but would it be acceptable in your use case to call the REST API after the issue creation as a workaround? For example, in CreateIssueModal’s onClose, perhaps? There, the payload should contain the issue IDs of the created issues.

If you are referring to the ability to do this via the native UI, then yes you can create an issue for a specific sprint. However, in my understanding, assigning the sprintId through the CreateIssueModal context is not yet possible.