---
title: "How to determine fields for addTask"
canonical: "https://support.appfire.com/space/SUPPORT/89135990/How%20to%20determine%20fields%20for%20addTask"
format: markdown
---
> Macro (div)
> 
> ### On this page
> 
> > Macro (toc)

# Summary

The [addTask](https://appfire.atlassian.net/wiki/display/BCLI/Reference#Reference-addTask) action can be used to add arbitrary tasks to a job. However, you must know the parameter fields that each task uses and needs. Normally, the task provider doesn't document this. However, they can be discovered. We have documented some examples already - see [Examples for AddTask action](https://appfire.atlassian.net/wiki/spaces/SUPPORT/pages/89136144). If the task you want is not already documented, then you need to discover the fields needed.  There are 2 ways to discover these fields.

1. Using **exportPlan** on an existing plan that has been created manually through the UI.
2. Using browser tools to discover fields from the UI. I use Crome → Developer Tools to look at the request details when you save a task from the UI.

# Steps using exportPlan

> Macro (table-plus)
> 
> | **Step** | **Discussion ** |
> | --- | --- |
> | Find or create a plan using the UI that has a task that you would like to |  |
> | Go to the command line and run the **exportPlan** action on the plan and find the task in the exported data | You are mostly interested in the fields that are exported.<br>If there are more than 8 fields, you may need to convert some of the fields to use the **fields** parameter. |

# Steps using UI 

> Macro (table-plus)
> 
> | **Step** | **Discussion ** |
> | --- | --- |
> | In Chrome, to to View → Developer → Developer Tools → Network tab | Or similar tool that captures interactions between your browser and the server. |
> | Go to the UI to add a task manually |  |
> | Either **add** or **update** a task that you want to automate |  |
> | Save the task | Try to fill in or select most fields you are interested in so they will show up as being set. |
> | Look for a POST and a line under that contains fields and values looking like your task input | Look for field names that match fields on the screen. There are lots of other fields that should be ignored.<br>Example: selectedRepository_0=defaultRepository&cleanCheckout=true |
> | Add the fields to the [addTask](https://appfire.atlassian.net/wiki/display/BCLI/Reference#Reference-addTask) action using the various **field** parameters | Example: **--field "myfield=myvalue"** or similarly with **field1**,** value1**,** etc ...** |

> ✅ **Alternative for getting field names**
> ✅ 
> ✅ An alternative approach you can use is to use your browsers **Inspect Element** support to get the name of fields from the UI. Click on the input field, right click -> Inspect Element and look for the **name** of the field.

# Examples

> Macro (include)