Skip to content

Unable to start multiple sprint in a single project #128

@surajheadsup

Description

@surajheadsup

Image

As you can see in the image I am not able to start more than 1 sprint in a single project.

Requirement :
if multiple developers are working at a same time on multiple modules like

2 developer on users and 2 on dashbaord, then if I start 1 sprint and then try to start another sprint then older one gets closed.

I also tried to remove the start_sprint function but bot working.
old code

Tables\Actions\Action::make('start')
                    ->label(__('Start sprint'))
                    ->visible(fn($record) => !$record->started_at && !$record->ended_at)
                    ->requiresConfirmation()
                    ->color('success')
                    ->button()
                    ->icon('heroicon-o-play')
                    ->action(function ($record) {
                        $now = now();
                        Sprint::where('project_id', $record->project_id)
                            ->where('id', '<>', $record->id)
                            ->whereNotNull('started_at')
                            ->whereNull('ended_at')
                            ->update(['ended_at' => $now]);
                        $record->started_at = $now;
                        $record->save();
                        
                    }),

Tables\Actions\Action::make('start')
                    ->label(__('Start sprint'))
                    ->visible(fn($record) => !$record->started_at && !$record->ended_at)
                    ->requiresConfirmation()
                    ->color('success')
                    ->button()
                    ->icon('heroicon-o-play')
                    ->action(function ($record) {
  //either this or
                        $now = now();
                      
                        $record->started_at = $now;
                        $record->save();

//or this

                        $now = now();
$record->update(['started_at' => $now]);
                    }),

Both codes tried but not worked

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions