nani9999,
You will need to provide the Artifact type in your JSON. Below is an update to your code that should work for you. I am also assuming 'StoryType' is a Custom String Field. You will need to update the name to 'c_StoryType' to add a value to a Custom Field.
I also removed some of the extra lines. Since you are using an API Key and setting it as the ZSessionID in the Headers, you will not need the Security Token to create the Artifact.
import requests, json
rally_defect = 'https://rally1.rallydev.com/slm/webservice/v2.0/hierarchicalrequirement'
workspace_ref = 'https://rally1.rallydev.com/slm/webservice/v2.0/workspace/123***'
fe_project_ref = 'https://rally1.rallydev.com/slm/webservice/v2.0/project/134***'
user_ref = 'https://rally1.rallydev.com/slm/webservice/v2.0/user/106***'
l2_ref = 'https://rally1.rallydev.com/slm/webservice/v2.0/portfolioitem/l2roadmapitem/166***'
headers = {"Accept": "application/json", "Content-Type": "application/json", "ZSESSIONID" : "_iv********"}
s = requests.Session()
url = rally_defect + '/create'
payload = {
"HierarchicalRequirement" : {
"Workspace" : workspace_ref,
"Name" : "Tesing",
"Description" : "Testing",
"Project" : fe_project_ref,
"c_StoryType" : "New Feature",
"PortfolioItem" : l2_ref,
"Owner" : user_ref,
"ScheduleState" : "Defined"
}
}
r = s.put(url, data=json.dumps(payload), headers=headers)
print r.text
print r.status_code