CreateRawDataSubTaskArgs creates a new instance of api.RawDataSubTaskArgs based on the provided task context, raw table name, and a flag to determine if the company ID should be used. It returns a pointer to the created api.RawDataSubTaskArgs and a pointer to the filtered TapdTaskData.
(taskCtx plugin.SubTaskContext, rawTable string)
| 155 | // task context, raw table name, and a flag to determine if the company ID should be used. |
| 156 | // It returns a pointer to the created api.RawDataSubTaskArgs and a pointer to the filtered TapdTaskData. |
| 157 | func CreateRawDataSubTaskArgs(taskCtx plugin.SubTaskContext, rawTable string) (*api.RawDataSubTaskArgs, *TapdTaskData) { |
| 158 | // Retrieve task data from the provided task context and cast it to TapdTaskData |
| 159 | data := taskCtx.GetData().(*TapdTaskData) |
| 160 | // Create a filtered copy of the original data |
| 161 | filteredData := *data |
| 162 | filteredData.Options = &TapdOptions{} |
| 163 | *filteredData.Options = *data.Options |
| 164 | // Set up TapdApiParams based on the original data |
| 165 | var params = TapdApiParams{ |
| 166 | ConnectionId: data.Options.ConnectionId, |
| 167 | WorkspaceId: data.Options.WorkspaceId, |
| 168 | } |
| 169 | // Create the RawDataSubTaskArgs with the task context, params, and raw table name |
| 170 | rawDataSubTaskArgs := &api.RawDataSubTaskArgs{ |
| 171 | Ctx: taskCtx, |
| 172 | Params: params, |
| 173 | Table: rawTable, |
| 174 | } |
| 175 | // Return the created RawDataSubTaskArgs and the filtered TapdTaskData |
| 176 | return rawDataSubTaskArgs, &filteredData |
| 177 | } |
| 178 | |
| 179 | // getTapdTypeMappings retrieves story types from _tool_tapd_workitem_types and maps them to |
| 180 | // typeMapping. It takes TapdTaskData, a Dal interface, and a system string as arguments. |
no test coverage detected