⭐️⭐️⭐️ Open-source, self-hosted alternative to Linear and Plane. Project management and issue tracking where teams and AI agents work side by side to plan and ship products.
TypeScript agenticagileai-agentsbug-reportingbug-trackerganttissue-trackerjirajira-alternativekanbanlinearlinear-alternativeopen-sourceproduct-managementproject-managementroadmapself-hostedsprint-planningteam-collaborationtrello-alternative
// Changing the state of an issue listed on another issue's page: a subtask, the
// parent, a linked issue. The list is read from the viewed issue's detail, so that
// detail and its feed refresh too, besides what useUpdateIssue refreshes for the
// changed issue.
import { useQueryClient } from '@tanstack/react-query';
import { useUpdateIssue } from '@/services/issues.service';
import { qk } from '@/services/queryKeys';
export function useSetRelatedIssueState(projectKey: string, viewedIssueId: number) {
const qc = useQueryClient();
const updateIssue = useUpdateIssue(projectKey);
return (issueId: number, columnId: number) =>
updateIssue.mutate(
{ id: issueId, patch: { columnId } },
{
onSettled: () => {
void qc.invalidateQueries({ queryKey: qk.issue(viewedIssueId) });
void qc.invalidateQueries({ queryKey: qk.feed(viewedIssueId) });
},
},
);
}