When an Issue is assigned to a Sprint, story points should not be blank
Asked by Gopikrishna Mamidipudi:

When an Issue is assigned to a Sprint, story points should not be blank


Answers:
author: Jacques
body: Hello [@Gopikrishna Mamidipudi](/t5/user/viewprofilepage/user-id/5546361),

I have just created this automation, and it works for me:

![Screenshot 2024-07-18 074323.png](https://community.atlassian.com/t5/image/serverpage/image-id/336234i27DC95654DD5F8D3/image-size/large?v=v2&px=999 "Screenshot 2024-07-18 074323.png")

It's pretty simple: The rule checks for every change in the Sprint field. If there is a change, it then checks the value of the Story Points field. If this field is empty, then it removes the value from the Sprint.

You can further adapt this as necessary.

This is the exported automation rule (save the text as .json) and then import it in your instance. Some updates might be required.

```
{"cloud":true,"rules":[{"id":20566842,"clientKey":"9f6d66b3-f584-3276-85f4-ba3ca4f68737","name":"Remove sprint if Story Points is empty","state":"ENABLED","description":"","authorAccountId":"557058:2ea5f4bb-5249-42bb-9eae-b792574d5001","actor":{"type":"ACCOUNT_ID","value":"557058:f58131cb-b67d-43c7-b30d-6b58d40bd077"},"created":1721281192266,"updated":1721281192266,"trigger":{"id":"490049582","component":"TRIGGER","parentId":null,"conditionParentId":null,"schemaVersion":2,"type":"jira.issue.field.changed","value":{"changeType":"ANY_CHANGE","fields":[{"value":"Sprint","type":"fieldName"}],"actions":[]},"children":[],"conditions":[],"connectionId":null},"components":[{"id":"490049583","component":"CONDITION","parentId":null,"conditionParentId":null,"schemaVersion":3,"type":"jira.issue.condition","value":{"selectedField":{"type":"NAME","value":"Story Points"},"selectedFieldType":"com.atlassian.jira.plugin.system.customfieldtypes:float","comparison":"EMPTY","compareValue":null},"children":[],"conditions":[],"connectionId":null},{"id":"490049584","component":"ACTION","parentId":null,"conditionParentId":null,"schemaVersion":10,"type":"jira.issue.edit","value":{"operations":[{"field":{"type":"NAME","value":"Sprint"},"fieldType":"com.pyxis.greenhopper.jira:gh-sprint","type":"SET","value":null}],"advancedFields":null,"sendNotifications":true},"children":[],"conditions":[],"connectionId":null}],"canOtherRuleTrigger":false,"notifyOnError":"FIRSTERROR","projects":[],"labels":[],"tags":[],"ruleScope":{"resources":["ari:cloud:jira::site/b36b6567-78b1-4f62-a4c6-075678c97824"]},"ruleHome":{"ruleLifecycleHome":{"locationARI":"ari:cloud:jira-core::site/b36b6567-78b1-4f62-a4c6-075678c97824"},"ruleBillingHome":{"locationARI":"ari:cloud:jira-core::site/b36b6567-78b1-4f62-a4c6-075678c97824"}},"writeAccessType":"UNRESTRICTED","collaborators":[],"billingType":"NORMAL"}]}
```

Hope this helps!

[Gopikrishna Mamidipudi](https://community.atlassian.com/t5/user/viewprofilepage/user-id/5546361)


author: Adolfo Casari
body: I am not sure whether you can implement a validator within automation, but you could reset the Sprint back to empty if Story Points is empty .... or flag the issue:

<https://community.atlassian.com/t5/Jira-questions/Use-automation-to-flag-issue/qaq-p/1415974>

to highlights issues in the sprint without estimation (actually I would do this when you start the sprint). Then you can add another rule that unflag the issue when the estimation is set.

Hope it helps,

comments: author: Gopikrishna Mamidipudi
body: Okay. Can I at least pop-up a message that "Ticket cannot be assigned to a Sprint till you enter the Story Points for it."?


author: Gopikrishna Mamidipudi
body: When I Add a Comment - can I @ the Assignee in the comment?


author: Trudy Claspill
body: Yes, if you are talking about adding a comment in an Automation Rule. Refer to

<https://support.atlassian.com/cloud-automation/docs/jira-smart-values-users/>


author: Gopikrishna Mamidipudi
body: I have the following Automation but how do I get it to work?

"When Value Changes for SPRINT?"

"If SPRINT is not empty?

If STORY POINTS is empty?

Edit STORY POINTS


author: Trudy Claspill
body: Hello [@Gopikrishna Mamidipudi](/t5/user/viewprofilepage/user-id/5546361)

Welcome to the Atlassian community.

Please provide screen images of the rule you have created and explain how the results are not what you expect.

Please also provide screen images showing the details of the Audit Log for the rule execution.

comments: author: Gopikrishna Mamidipudi
body: ![Picture1.png](https://community.atlassian.com/t5/image/serverpage/image-id/336398iA806DEC859E02AB4/image-size/large?v=v2&px=999 "Picture1.png")![Picture2.png](https://community.atlassian.com/t5/image/serverpage/image-id/336399i66122AE4F6A63FA3/image-size/large?v=v2&px=999 "Picture2.png")![Picture3.png](https://community.atlassian.com/t5/image/serverpage/image-id/336401i80C6FA09D28B5E7D/image-size/large?v=v2&px=999 "Picture3.png")![Picture4.png](https://community.atlassian.com/t5/image/serverpage/image-id/336402i4BC7BB045E3B0C8A/image-size/large?v=v2&px=999 "Picture4.png")

Story Points is EMPTY and I'm able to assign the ticket to a Sprint.

Nothing happened -- and it shows a SUCCESS in the AuditLog.

I was hoping the last step in Rule -- "Edit Story Points" -- will pop up the JIRA ticket and not save the Sprint info.


author: Trudy Claspill
body: ![Screenshot 2024-07-18 at 9.30.56?AM.png](https://community.atlassian.com/t5/image/serverpage/image-id/336437i03687281BA43A346/image-size/large?v=v2&px=999 "Screenshot 2024-07-18 at 9.30.56?AM.png")

This rule worked for me.

Did you make sure to refresh the issue view after the rule completed?


author: Gopikrishna Mamidipudi
body: What am I looking for? Will the cursor go land in the Story Points field? I'm not sure what to expect with the action "Edit"?


author: Trudy Claspill
body: Rules run in the background using the Jira REST API. The execution of the rule will not open any screens or pop up any messages.

When you change the sprint field directly in the issue view or through the Backlog screen, that will trigger the rule. The rule will run. After the rule completes you would need to refresh the tab where you have the issue displayed in order to see changes made by the rule.


Tags: workflow