Effortless User Story Creation
Tags: powerautomate, chatgpt, powerfuldevs, agile
Published: 2023-05-10 09:34:59

The ability to create effective user stories is crucial for success in modern software development process. User stories capture the needs, desires, and expectations of users, serving as the foundation for agile development processes. With ChatGPT (an advanced AI language model) now available the idea is to explore how leverage this to craft user stories. 

User Story structure that we would leverage with this experiment is as below

## As a [Persona], I want to [feature/activity] so that [value/benefit].

Lets now explore how ChatGPT can empower software development teams to effortlessly generate user stories as templates which the product team can enrich to ensure it is not misinterpreted by the software development team

**Conceptual Architecture View**:
The idea here is to leverage the AI powered ChatGPT to structure draft user stories based on the persona and the feature that needs to be leveraged and some recommendation of acceptance criteria. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9flbkihwg4m1vkq8tcqo.png)


**Conceptual Architecture View**:
The flow would look something as below. 

1. Initialized 3 variables. Couple of them as String Variable to map the inputs from the excel data and one array variable to map the output. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dg9zciy186sqetpq38uv.png)

2.Have leverage "List rows present in a table" to read the entries in the excel (created as table)

3.Have looped through for every entry in the excel spreadsheet and mapped the User Persona and Feature input to the 2 string variables

4.The below instruction was leveraged to generate user story based on the variable parsed in the above steps.

```
Try to create a user story with the format:
 "As a [type of user], I want [an action or feature], so that [a benefit or goal]."

Recommend few acceptance criteria 

Do not add any further information 

[Start of topic]
 @{variables('Persona')}and the task or the feature  is @{variables('Feature')}
[End of topic]
```
 

5.The output from the step 4 was passed to append the array variable initialised in the first step 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/84qy2is21f4u5kjyub6n.png)

6.Map the output of the AI power ChatGPT text response as Item to create CSV 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qmz21ve1wu0kcq9x44na.png)



The complete flow would look like below

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rema1j8jxdvt0rpzjdwm.png)





**Data Setup**:

| Persona          	| Feature                                                   	|
|------------------	|-----------------------------------------------------------	|
| Buyer            	| create   a new purchase order                             	|
| Buyer            	| add items to a purchase order                             	|
| Buyer            	| Review   and submit a purchase order                      	|
| Customs   Broker 	| review import/export documents                            	|
| Customs Broker   	| track   the status of shipments                           	|
| Customs   Broker 	| generate and submit customs declarations   electronically 	|





**Sample Output**:

| UserStory - Output                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| As a   buyer, I want to create a new purchase order, so that I can purchase the   necessary items for my business.<br>     <br>     Acceptance Criteria:<br>     - The purchase order should include the necessary details of the items to   be purchased<br>     - The purchase order should be able to be sent to the supplier<br>     - The purchase order should be able to be tracked and monitored for   delivery status                                                                                |
| As a   buyer, I want to add items to a purchase order, so that I can complete my   purchase.<br>     <br>     Acceptance Criteria:<br>     - The buyer should be able to select items from a list of available   items<br>     - The buyer should be able to specify the quantity of each item to be   added<br>     - The buyer should be able to view the total cost of the purchase order   before submitting it                                                                                           |
| As a   buyer, I want to review and submit a purchase order, so that I can complete   my purchase.<br>     <br>     Acceptance Criteria:<br>     - The buyer should be able to review the purchase order details.<br>     - The buyer should be able to submit the purchase order.<br>     - The purchase order should be successfully submitted.                                                                                                                                                              |
| As a   Customs Broker, I want to review import/export documents, so that I can   ensure compliance with customs regulations.<br>     <br>     Acceptance Criteria:<br>     1. The documents must be reviewed within a specified timeframe.<br>     2. The documents must be reviewed for accuracy and completeness.<br>     3. The documents must be reviewed for any discrepancies.<br>     4. The documents must be reviewed for any potential risks.                                                       |
| As a   Customs Broker, I want to track the status of shipments, so that I can   provide accurate updates to my clients.<br>     <br>     Acceptance Criteria:<br>     - The tracking system should be able to provide real-time updates on the   status of shipments.<br>     - The tracking system should be able to provide detailed information on the   location of the shipment.<br>     - The tracking system should be able to provide information on the   estimated time of arrival of the shipment. |
| As a   Customs Broker, I want to generate and submit customs declarations   electronically, so that I can save time and reduce paperwork.<br>     <br>     Acceptance Criteria:<br>     1. The system should be able to generate customs declarations   electronically.<br>     2. The system should be able to submit customs declarations   electronically.<br>     3. The system should be able to save time and reduce paperwork.                                                                         |


The above automation could help with the basic content but this could be enriched during story refinement sessions. It is conducted to review, clarify, and refine user stories or backlog items before they are brought into a sprint for development. The product owner, development team, and other stakeholders come together to discuss and analyze user stories in detail


By leveraging ChatGPT's insights and recommendations, agile teams can streamline their development process, saving time and effort while maintaining a high level of quality and precision.