Extend work item create mutation to accept optional createSource param
What does this MR do and why?
This is an atomic slice of Draft: All plan instrumentation (!210502) , in order to differentiate work items being created from different sources (lists, boards, global nav, vulnerabilities, child items widget etc), an optional parameter to the create mutation is added.
Due to multi-version compatibility, the aim is to ship this API change in %18.6 and then integrate with it in %18.7. The way it is integrated is shown in that above MR. The create work item Vue component has a computed prop which is the creatSource, and then different parent components populate it accordingly. The WorkItems::CreateService then excludes and stores that param before creating the work item, and then passes it into the TrackingService to track the correct internal event.
Note for Reviewers
Although this mixes instrumentation with business logic in the public API, I believe in this case there is strong justification for some of the following reasons:
- Optional and non breaking param with clear documentation, existing API consumers would be totally unaffected
- All things equal, tracking in the backend is superior to the frontend as snowplow collection can be blocked by privacy based browser extensions
- One of the issues we currently have with our instrumentation is that it is non-standardized with disparate event tracking all over the place. The aim of this work stream and overhauling our tracking is in part to standardize the way that we do this, and by making calls in a single backend service object, this is achieved
- Any new UI flow that creates work items simply needs to populate the
createSourceprop, add the new matching event definition, and then it✨ just works✨
Related to #579374